The issue was that when inserting a key, other keys weren't deselected
even though that feature was implemented with 6ef77a0d22
That only happened if no FCurve channel was selected in the channel list.
It turns out, that the intent of using the animfilter flags from
the editor was wrong. The animfilter code already checks the editor
flags based on the `bAnimContext` that is passed in.
In fact the drawing code itself has hardcoded flags.
So the fix is to use hardcoded flags as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/129636
The primitive tool didn't write to the `fill_opacity` attribute meaning that primitives wouldn't
show up correctly when using fill materials with a strength < 1.
The fix does multiple things:
* Make sure to create and write to the `fill_opacity` attribute if necessary.
* Remove the `skipped_attribute_ids` function and build the set of attributes to skip
where the attributes are written to. This is more flexible.
Pull Request: https://projects.blender.org/blender/blender/pulls/129644
Snapping the 3D cursor to a grease pencil selection would include
locked layers in the computation of the centroid. This is inconsistent
with 4.2.
The fix makes sure that we skip over layers that are locked.
Pull Request: https://projects.blender.org/blender/blender/pulls/129639
Previously, we initialized the layers and groups to hide masks.
For layers this makes sense, because they don't have any masks
by default, but for groups it makes more sense to show masks
by default for all the layers inside.
Pull Request: https://projects.blender.org/blender/blender/pulls/129528
In lieu of fixing the root cause, this commit requires the object to be
in object mode to duplicate particle systems, which works around the
issue because the problem is with particle edit data. This is a pragmatic
choice to focus development efforts on replacing the particle system.
Introduced with 5fff95f519.
There were several issues:
* The indices into `edit_points_vflag` are incorrect. They need to be offset
by the start offset of the drawing.
* The code was writing to `edit_points_vflag` even if the layer is locked.
But the size of the `edit_points_vflag` buffer is not counting locked layers.
Pull Request: https://projects.blender.org/blender/blender/pulls/129625
This reverts commit 0a70360eb6. That's
because it caused issue #129366 which is much more serious, and the
cause is not obvious so far. Another fix will be submitted for the
original issue.
Aligns Bezier handles when both handles are of the`BEZIER_HANDLE_ALIGN`
type. If the left handle is selected, then the right one is aligned
with it. The left handle is aligned with the right handle only if the
left handle is not selected.
Rel #105038
Pull Request: https://projects.blender.org/blender/blender/pulls/128726
Rotating an edge deletes the edge and creates a new edge
however these edges were being iterated over and had their indices
checked.
In practice this wasn't causing use-after-free errors because the
edges are part of a BLI_mempool, nevertheless using freed elements of a
memory-pool should be avoided.
FONT_OT_style_toggle returned `true` instead of the canceled flag
causing it to run as a modal operator which leak memory from it's
reports when called from Python.
This commit sets the default value of the number of frustum planes
for the PBVH to zero to prevent accessing invalid memory in cases where
the data may otherwise be uninitialized.
Pull Request: https://projects.blender.org/blender/blender/pulls/129600
Refactor 1dbe94c8ac restored the 'old' proper way to directly call the
python type (i.e. use the python's implementation to create objects),
instead of using the 'specialized' type creation code.
However, the handling of the ugly `rna_disallow_writes` global was only
added later to the 'workaround' part of the code, but not to the original
'canonical' one.
This commit copies the handling of `rna_disallow_writes` back into the
now active part of the code.
This solves the `is_readonly_init` unused variable build warning.
NOTE: At some point the BPY code needs a good cleanup pass, there are
way to many pieces of codes #ifdef'ed there.
The existing Volume export, which already supports VDB file sequences
and static volumes created inside Blender, is now extended to handle
dynamically created and modified volumes. This allows scenarios where a
Volume Displace modifier is placed over-top an existing VDB sequence or
when Geometry Nodes is used to create animated volumes procedurally.
Detection of what counts as animation is simplistic and mimics what has
been used for Meshes. Essentially if there are any modifiers on the
volume we assume that the volume is "varying" in some way. This can lead
to situations where new volume files are written unnecessarily.
Volume import was also adjusted to correctly set the sequence "offset"
value. This is required to properly handle the case when a VDB sequence
begins animating at a different frame than what's implied by the file
name. For example, a VDB file sequence with file names containing 14-19
but the user wants to animate on frames 8-13 instead.
Tests are added which cover:
- Animated VDB file sequences
- Animated Mesh To Volume where the mesh has been animated
- Animated Volume Displacement where displacement settings are animated
- Animated Volumes created with a Geometry Nodes simulation
----
New test data has been checked in: `tests/data/usd/usd_volumes.blend` and files inside `tests/data/usd/volume-data/`
Pull Request: https://projects.blender.org/blender/blender/pulls/128907
For now, PointerRNA is made non-trivial by giving explicit default
values to its members.
Besides of BPY python binding code, the change is relatively trivial.
The main change (besides the creation/deletion part) is the replacement
of `memset` by zero-initialized assignment (using `{}`).
makesrna required changes are quite small too.
The big piece of this PR is the refactor of the BPY RNA code.
It essentially brings back allocation and deletion of the BPy_StructRNA,
BPy_Pointer etc. python objects into 'cannonical process', using `__new__`,
and `__init__` callbacks (and there matching CAPI functions).
Existing code was doing very low-level manipulations to create these
data, which is not really easy to understand, and AFAICT incompatible
with handling C++ data that needs to be constructed and destructed.
Unfortunately, similar change in destruction code (using `__del__` and
matching `tp_finalize` CAPI callback) is not possible, because of technical
low-level implementation details in CPython (see [1] for details).
`std::optional` pointer management is used to encapsulate PointerRNA
data. This allows to keep control on _when_ actual RNA creation is done,
and to have a safe destruction in `tp_dealloc` callbacks.
Note that a critical change in Blender's Python API will be that classes
inherinting from `bpy_struct` etc. will now have to properly call the
base class `__new__` and/or `__init__`if they define them.
Implements #122431.
[1] https://discuss.python.org/t/cpython-usage-of-tp-finalize-in-c-defined-static-types-with-no-custom-tp-dealloc/64100