diff options
author | Demeter Dzadik <Mets> | 2022-01-10 14:58:49 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-01-10 15:01:01 +0300 |
commit | 3ec88ae21df95546914863d80de4a76c8d3e3476 (patch) | |
tree | e46b6875b251f0cbacd375ec0fbce0aeaa8dc30a /release/scripts/modules | |
parent | f5e90a943f1150a067ca4334b4852c3a62df1597 (diff) |
Fix error when keyframing with Custom Properties
Since rBf9ccd26b037d, calling `data.path_resolve()` on custom properties
with `None` value do not cause a `ValueError` exception any more. This
is now taken into account in the keying sets targeting custom
properties.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D13787
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/keyingsets_utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/release/scripts/modules/keyingsets_utils.py b/release/scripts/modules/keyingsets_utils.py index de0b1435803..84a01ef3666 100644 --- a/release/scripts/modules/keyingsets_utils.py +++ b/release/scripts/modules/keyingsets_utils.py @@ -238,11 +238,15 @@ def RKS_GEN_custom_props(_ksi, _context, ks, data): continue prop_path = '["%s"]' % bpy.utils.escape_identifier(cprop_name) + try: rna_property = data.path_resolve(prop_path, False) except ValueError: - # 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. + # Can technically happen, but there is no known case. + continue + if rna_property is None: + # In this case the property cannot be converted to an + # FCurve-compatible value, so we can't keyframe it anyways. continue if rna_property.rna_type not in prop_type_compat: continue |