f4ae983dfbe3f25ea35c870625cd30030644e55d
This commit works on two related issues: 1. It is too easy to forget to handle ID refcounting in custom RNA setters. 2. It is not possible to fully force RNA refcounting ON or OFF for some properties. Issue 1. has bit us several times recently (e.g. in animation or compositor areas, see latest fix blender/blender!143577). This commit addresses it by adding some debug-only checks around the call to `PointerPropertyRNA::set()` in `RNA_property_pointer_set()`, that validates that usercount of both previously and newly assigned IDs matches expected (changes of) values. While not ideal, this should make it way easier for developers to catch that issue in the future. The second issue was discovered while working on the first, leading to e.g. questionable work-arounds like the `rna_DriverTarget_id_set` setter, only defined to by-pass the automatically assigned `PROP_ID_USERCOUNT` flag (and related automatic refcounting of the default setter code). It is addressed by adding an internal `PROP_INTERN_PTR_ID_REFCOUNT_FORCED` flag, which keeps track of calls to `RNA_def_property_flag`/`RNA_def_property_clear_flag` which explicitely sets or clears the `PROP_ID_USERCOUNT` flag, and prevents automatic setting of that flag in that case. Pull Request: https://projects.blender.org/blender/blender/pulls/143660
…
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.
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
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
