[Bf-blender-cvs] [4d0643a1857] master: Fix T70447: 'WholeCharacter' Keying set doesn't key None properties

Sybren A. Stüvel noreply at git.blender.org
Tue Dec 10 15:15:30 CET 2019


Commit: 4d0643a1857ff36272a858065a0c8a28f31812c8
Author: Sybren A. Stüvel
Date:   Tue Dec 10 15:12:15 2019 +0100
Branches: master
https://developer.blender.org/rB4d0643a1857ff36272a858065a0c8a28f31812c8

Fix T70447: 'WholeCharacter' Keying set doesn't key None properties

The issue is that `something.path_resolve('"custom_property"')` raises a
`ValueError` when the custom property is set to `None`. Since `None`
cannot be stored in a keyframe anyway, the property is now silently
skipped. Not having an explicit value is the closest we can get to
`None`. This of course breaks when the value should be `None` in between
not-`None` values, but I would consider that as a problem with the rig,
and not something Blender can fix.

===================================================================

M	release/scripts/startup/keyingsets_builtins.py

===================================================================

diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py
index e24cbcfd18e..bebd10edde3 100644
--- a/release/scripts/startup/keyingsets_builtins.py
+++ b/release/scripts/startup/keyingsets_builtins.py
@@ -521,7 +521,13 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
             prop_rna = type(bone).bl_rna.properties.get(prop, None)
             if prop_rna is None:
                 prop_path = '["%s"]' % prop
-                if bone.path_resolve(prop_path, False).rna_type in prop_type_compat:
+                try:
+                    rna_property = bone.path_resolve(prop_path, False)
+                except ValueError as ex:
+                    # This happens when a custom property is set to None. In that case it cannot
+                    # be converted to an FCurve-compatible value, so we can't keyframe it anyway.
+                    continue
+                if rna_property.rna_type in prop_type_compat:
                     ksi.addProp(ks, bone, prop_path)
             elif prop_rna.is_animatable:
                 ksi.addProp(ks, bone, prop)



More information about the Bf-blender-cvs mailing list