From 88f298f66fadcb7b051dd463179220078258a352 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Wed, 16 Oct 2024 10:42:32 +0200 Subject: [PATCH] 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 --- scripts/modules/bpy_extras/anim_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/modules/bpy_extras/anim_utils.py b/scripts/modules/bpy_extras/anim_utils.py index 2edb2405b78..5b37a4b76d6 100644 --- a/scripts/modules/bpy_extras/anim_utils.py +++ b/scripts/modules/bpy_extras/anim_utils.py @@ -243,11 +243,14 @@ def bake_action_iter( return clean_props def bake_custom_properties(obj, *, custom_props, frame, group_name=""): + import idprop if frame is None or not custom_props: return for key, value in custom_props.items(): if key in obj.bl_rna.properties and not obj.bl_rna.properties[key].is_animatable: continue + if isinstance(obj[key], idprop.types.IDPropertyGroup): + continue obj[key] = value if key in obj.bl_rna.properties: rna_path = key