f8d38b65a442db71488eabb7c3ebb5cb72c275fc
Caused by6a49041be3. Above commit checks an existing nameproperty for collection items, but it does so in a way that it only checks the "parent" type. If these are "subclassed" though, we might not have the nameproperty defined on the "parent" class (but on the subclass instead). Code would then error out with e.g. "FreestyleLineStyle.color_modifiers does not support string lookups". In the case of the report the following happened. - linestyle modifiers (`LineStyleModifier`) can be any of: -- `color_modifiers` / `LineStyleColorModifier` -- `alpha_modifiers` / `LineStyleAlphaModifier` -- `thickness_modifiers` / `LineStyleThicknessModifier` -- `geometry_modifiers` / `LineStyleGeometryModifier` But all of the above have subtypes, e.g. `LineStyleColorModifier_AlongStroke`, `LineStyleColorModifier_DistanceFromCamera`, ... Currently, the `nameproperty` is not defined e.g. on the `LineStyleColorModifier` (but instead on the subtypes). Prior to6a49041be3(without `RNA_property_collection_lookup_string_has_nameprop` in place), `pyrna_prop_collection_subscript_str` could still actually find the nameprop because it iterates into the collection and got it on the actual Item (`LineStyleColorModifier_DistanceFromCamera` instead of `LineStyleColorModifier`). So while it might be possible to refine `RNA_property_collection_lookup_string_has_nameprop` to descend into subclasses (I didnt find an obvious way though other than scanning all existing modifiers [not modifier types -- we would need a way to find all types that inherit from e.g. `LineStyleColorModifier`] which kind of defeats the purpose of checking this early), this PR moves the name definition from the subclass to the parent class (so way from `rna_def_modifier_type_common`) -- and this way, `RNA_property_collection_lookup_string_has_nameprop` can properly pick up the nameprop. It does a bit of code duplication though. Pull Request: https://projects.blender.org/blender/blender/pulls/113290
…
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%
