Fix #134034: Baking a custom property with a name existing in Blender failed
When baking custom properties that were named exactly the same
as a property already in Blender (in this case `scale`), it would fail.
The issue was introduced with eee32726c7 where the goal was
to not key addon defined properties.
The problem with that approach was that `obj.bpy_rna.properties`
not only contains addon defined properties but also all that are native to Blender.
So the rna path would be created to be identical as for e.g. transform properties.
The fix is to test the property for `is_runtime` which is true for addon
defined properties but false for blender internal properties
I tested with the test file of #121349 to confirm that doing so
doesn't bring that original bug back.
Pull Request: https://projects.blender.org/blender/blender/pulls/135297
This commit is contained in:
committed by
Christoph Lendenfeld
parent
16d819caa9
commit
a485bf6556
@@ -279,7 +279,10 @@ def bake_action_iter(
|
||||
if isinstance(obj[key], idprop.types.IDPropertyGroup):
|
||||
continue
|
||||
obj[key] = value
|
||||
if key in obj.bl_rna.properties:
|
||||
# The check for `is_runtime` is needed in case the custom property has the same
|
||||
# name as a built in property, e.g. `scale`. In that case the simple check
|
||||
# `key in ...` would be true and the square brackets would never get added.
|
||||
if key in obj.bl_rna.properties and obj.bl_rna.properties[key].is_runtime:
|
||||
rna_path = key
|
||||
else:
|
||||
rna_path = "[\"{:s}\"]".format(bpy.utils.escape_identifier(key))
|
||||
|
||||
Reference in New Issue
Block a user