Fix: Error when baking custom properties of unavailable addon
When baking an Action on an object which has custom properties that come from an addon or python script that isn't loaded, the baking would fail with: ``` TypeError: Cannot assign a 'dict' value to the existing 'hops' Group IDProperty ``` This comes from an addon that isn't present or loaded on a users machine. The fix is to check for `IDProperty` and skip those. Pull Request: https://projects.blender.org/blender/blender/pulls/129057
This commit is contained in:
committed by
Christoph Lendenfeld
parent
30adc33730
commit
88f298f66f
@@ -243,11 +243,14 @@ def bake_action_iter(
|
|||||||
return clean_props
|
return clean_props
|
||||||
|
|
||||||
def bake_custom_properties(obj, *, custom_props, frame, group_name=""):
|
def bake_custom_properties(obj, *, custom_props, frame, group_name=""):
|
||||||
|
import idprop
|
||||||
if frame is None or not custom_props:
|
if frame is None or not custom_props:
|
||||||
return
|
return
|
||||||
for key, value in custom_props.items():
|
for key, value in custom_props.items():
|
||||||
if key in obj.bl_rna.properties and not obj.bl_rna.properties[key].is_animatable:
|
if key in obj.bl_rna.properties and not obj.bl_rna.properties[key].is_animatable:
|
||||||
continue
|
continue
|
||||||
|
if isinstance(obj[key], idprop.types.IDPropertyGroup):
|
||||||
|
continue
|
||||||
obj[key] = value
|
obj[key] = value
|
||||||
if key in obj.bl_rna.properties:
|
if key in obj.bl_rna.properties:
|
||||||
rna_path = key
|
rna_path = key
|
||||||
|
|||||||
Reference in New Issue
Block a user