Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/keyingsets_utils.py
| Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | def RKS_GEN_custom_props(_ksi, _context, ks, data): | ||||
| # When working with a pose, 'id_block' is the armature object (which should | # When working with a pose, 'id_block' is the armature object (which should | ||||
| # get the animation data), whereas 'data' is the bone being keyed. | # get the animation data), whereas 'data' is the bone being keyed. | ||||
| for cprop_name in data.keys(): | for cprop_name in data.keys(): | ||||
| # ignore special "_RNA_UI" used for UI editing | # ignore special "_RNA_UI" used for UI editing | ||||
| if cprop_name == "_RNA_UI": | if cprop_name == "_RNA_UI": | ||||
| continue | continue | ||||
| prop_path = '["%s"]' % bpy.utils.escape_identifier(cprop_name) | prop_path = '["%s"]' % bpy.utils.escape_identifier(cprop_name) | ||||
| try: | |||||
| rna_property = data.path_resolve(prop_path, False) | 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 | if rna_property == None: | ||||
sybren: Always use `is None` to compare with None, so `if rna_property is None:` | |||||
| # be converted to an FCurve-compatible value, so we can't keyframe it anyway. | # In this case the property cannot be converted to an | ||||
| # FCurve-compatible value, so we can't keyframe it anyways. | |||||
| continue | continue | ||||
| if rna_property.rna_type not in prop_type_compat: | if rna_property.rna_type not in prop_type_compat: | ||||
| continue | continue | ||||
| path = "%s%s" % (base_path, prop_path) | path = "%s%s" % (base_path, prop_path) | ||||
| if grouping: | if grouping: | ||||
| ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping) | ks.paths.add(id_block, path, group_method='NAMED', group_name=grouping) | ||||
| else: | else: | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||
Always use is None to compare with None, so if rna_property is None: