Sybren A. Stüvel d989117f09 Fix: correct RNA property access in Rigify
Ensure that Rigify correctly handles RNA properties as RNA properties.
Before, it mixed dictionary-style and attribute-style access, but
since 7276b2009a that is no longer
possible.

This means that the (un)registration of the RNA properties needs to
happen in two places: the add-on itself, and the code it generates in
the rig. To be able to inject the code into a blend file, Rigify needs
to access it as string. This commit introduces a new way of dealing
with this: it just has normal code, and uses Python's
[`inspect.getsource()`][getsource] to get that code as string for
injection into the rig file.

[getsource]: https://docs.python.org/3/library/inspect.html#inspect.getsource

The biggest chunk of code in this commit deals with the 'Copy
Parameters', 'Copy Type & Parameters', and 'Mirror Type & Parameters'
operators. Since it's no longer possible to access RNA properties as
dict-like custom properties, new code was written to recursively copy
`bpy.types.PropertyGroup` instances. Eventually this may end up in
Blender itself, but that would mean writing more thorough checks and
making sure it works in many cases. And it might be easier to
implement this on the C++ side, where it should just be a matter of
exposing one `IDP_CopyPropertyContent()` call to the Python API.
That's all for another Blender release, though -- for now this'll have
to do to fix up Rigify for 5.0.

Fixes: #146675
Pull Request: https://projects.blender.org/blender/blender/pulls/147199
2025-10-07 11:37:12 +02:00
2025-10-07 10:19:46 +11:00
2025-10-02 18:34:11 +02:00
2023-12-08 13:28:13 +11:00
2025-07-10 12:48:33 +10:00
2025-10-07 10:19:46 +11:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%