255f031e3e265e51dc643cd4031dc32d50132aa6
Existing code had several issues: * The 'DNA bitset as RNA array' behavior was totally undocumented, virtually impossible to discover, very confusing, and without any checks that given parameters (like the array length) were valid. * The DNA defaults handling was fully broken for 'negative' boolean properties. This commit: * Factorizes all rna define code for boolean properties storing a `booleanbit` value into a new static util (this revealed and fixed the 'negative defaults' issue). * Forbids calling `RNA_def_property_array` on a Boolean property with a non-null `booleanbit` value. * Introduces a new `RNA_def_property_boolean_bitset_array_sdna`, strictly to define 'DNA bitsets as RNA array' properties. * Adds several validation checks, in particular regarding the bitset case: it takes into account the fact that bitshift operations on negative numbers are typically [arithmetic ones](https://en.cppreference.com/w/cpp/language/operator_arithmetic), which means that they preserve the sign of the value, and that the left-most bit should never be used with signed integers for bitsets. ------------------- The fix to DNA defaults handling on 'negative' properties revealed several RNA errors, listed below. Fixing them is not necessarily trivial (as some seem to contradict the DNA default values, e.g. the `View3DShading.use_studiolight_view_rotation` one), so it is kept outside of this refactor. Conflicting cases should likely be handled by the relevant modules (to decide whether the DNA, or the RNA default should be kept). ------------------- Also realized that many DNA types are ignored when trying to find DNA default values. This will also be tackled separately, as fixing it is fairly straightforward. Pull Request: https://projects.blender.org/blender/blender/pulls/132917
…
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%
