In this specific code path (recursive reading inside .blend files
containing assets), reading datablocks marked as asset would move
ownership over the asset metadata without indicating that in the source
that owned it previously. This would cause a double free attempt.
It was a bit odd having `ED_view3d_grease_pencil_selection_domain_get`
in the `ED_view3d.h` header.
Moving it to `ED_grease_pencil.h` makes more sense.
This patch adds support for two of the three selection domains in the Edit Mode tool settings: point and stroke.
Affected selection operators: select all, lasso select, select pick, box select.
Pull Request: https://projects.blender.org/blender/blender/pulls/108970
There where glitches while weight painting in Grease Pencil with
auto-normalize enabled. This resulted in incorrect weights on vertices.
And sometimes a vertex group not deformed by bones was also affected
by auto-normalize (which should never happen).
This was due to:
- An erroneous line in the auto-normalize function which led to an
index out of bounds (and screwing up the vertex weights).
- An edge case where the active vertex group was de facto the only
group to be normalized.
Also in this patch:
- Removal of unreachable code
- Better names for the auto-normalize functions
Pull Request: https://projects.blender.org/blender/blender/pulls/109036
There is an optimization to avoid creating the attribute if we only
set faces smooth. But since "use_smooth" and "sharp_face" are
inverted, the check for that case needs to be invertex compared
to other similar attribute setters.
`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.