Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2019-12-10 17:12:15 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-12-10 17:12:15 +0300
commit4d0643a1857ff36272a858065a0c8a28f31812c8 (patch)
treee39170c80df6dfe6d6bf9f26f324365886b36858 /release/scripts/startup/keyingsets_builtins.py
parent96a1bc2997c871a3405dd0a41d780eee49c2c8bb (diff)
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.
Diffstat (limited to 'release/scripts/startup/keyingsets_builtins.py')
-rw-r--r--release/scripts/startup/keyingsets_builtins.py8
1 files changed, 7 insertions, 1 deletions
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)