`strcpy` could overflow the destination buffer by 768 bytes,
use FILE_MAX for the filepath buffer size.
Also include the size in the functions signature to avoid similar
errors in the future.
The Python API uses the term size for string lengths for
PyUnicode_AsUTF8AndSize and related API's, causing Blender's return
arguments to use the term `size` too in some cases.
This is error prone since Blender includes space from the the null byte
when the term size is used (by convention).
Just avoid creating links to outside the group. The original
version worked a little more accurately. But still she was just
making up links (because the inline version of the graph wasn't the same anyway).
For now, this is just a workaround to work around the
problem in the new behavior caused by fa3ca9afdb .
Pull Request: https://projects.blender.org/blender/blender/pulls/108332
It's a bit unfortunate that the `node_map` in both cases has different
constness, so a conversion or `reinterpret_cast` is necessary. For now
a new temporary map is created as this is less error prone. That's not
ideal but better than the duplication from before.
Searching for a simulation state at a particular frame was implemented
with a linear loop. The timeline did that for every visible frame,
giving quadratic performance overall when zoomed out. Since the
states are already assumed to be sorted by frame, we can use binary
search instead giving logarithmic performance for each lookup instead.
In the test file from #108097, instead of dropping to 20-30 FPS
after about 4000 frames, I observed the original 70 FPS.
Pull Request: https://projects.blender.org/blender/blender/pulls/109037
Searching for a simulation state at a particular frame was implemented
with a linear loop. The timeline did that for every visible frame,
giving quadratic performance overall when zoomed out. Since the
states are already assumed to be sorted by frame, we can use binary
search instead giving logarithmic performance for each lookup instead.
In the test file from #108097, instead of dropping to 20-30 FPS
after about 4000 frames, I observed the original 70 FPS.
Pull Request: https://projects.blender.org/blender/blender/pulls/109037
More consistently return geometry bounds with the `Bounds` type that
holds the min and max in one variable. This simplifies some code and
reduces the need to initialize separate min and max variables first.
Meshes now use the same `bounds_min_max()` function as curves and
point clouds, though the wrapper mesh isn't affected yet.
The motivation is to make some of the changes for #96968 simpler.
No user visible changes expected.
Adds an assert to check that only one item returns true in its
`should_be_active()` method. This can help find some errors.
No user visible change expected (this isn't used in existing code yet).
Users of the tree-view API should be able to write their own `matches()`
method to compare tree-view elements after tree reconstruction. Part of
the tree-view matching process wouldn't use this though, and use the
`matches_single()` method instead, causing issues like multiple items
sharing the same state. This was initially done for an optimization
(the default `matches()` compares parents as well, which seems redundant
here), but it backfires and actually isn't needed. The default
`matches()` only compares the parents when `matches_single()` returns
true anyway, so the redundancy is really minor and not a performance
concern.
Fix a crash introduced in dd648b5942.
This is caused by replacing a C designated initialisation with a simple
attribute assignment in C++. The C code would initialise all fields to
zero by default, whereas the C++ code leaves them untouched and thus at
a random value.
The hover highlight is done with some special handling that wasn't
called for buttons in menus. There's actually no case where this happens
in the main branch but it's needed for #104831.
No user visible changes expected.
It makes sense to disable embossing for drawing the tree view (so it
doesn't have to be disabled for every item individually), but then the
mouse hover highlight should still work.
The makes the zone analysis result a bit more well defined.
For example, `child_nodes` now never contains nodes that belong
to child zones.
Also, one can now easily access the set of top level nodes and zones.
The flag in bNodePanel is anticipated to store settings such as whether
a panel is open or closed by default. It's not currently used, so for
now the flag is removed.
The next_panel_identifier in bNodeTree is also not needed any more. It
was used to set a unique identifier for each panel, which isn't needed.
Added comments to remaining fields in bNodePanel.
Pull Request: https://projects.blender.org/blender/blender/pulls/109028
Modifiers can use the same bake directory now. If multiple modifiers
using conflicting paths are baked at the same time there is now an
error popup.
Modifiers can also bake to directories that already contain data
(including their own). To give users a heads-up there is now a
confirmation popup in that case. It only comes up once per bake operator
invoke to strike a balance between silently overwriting data and not
being too obnoxious when users want to rebake the same simulation many
times.
Pull Request: https://projects.blender.org/blender/blender/pulls/108288