Fix T52401: "Export Keying Set" operator generated incorrect ID's for shapekeys

To be backported.
This commit is contained in:
Joshua Leung 2017-08-18 01:03:28 +12:00
parent 8141eac2f8
commit 743bacaa6f
Notes: blender-bot 2023-04-14 09:18:04 +02:00
Referenced by issue blender/blender-addons#52401, Default Shape Key ID in Keying Set files broken - TypeError: 'builtin_function_or_method' object is not subscriptable
1 changed files with 3 additions and 0 deletions

View File

@ -137,6 +137,9 @@ class ANIM_OT_keying_set_export(Operator):
break
else:
self.report({'WARN'}, "Could not find scene using Compositor Node Tree - %s" % (ksp.id))
elif ksp.id.bl_rna.name == "Key":
# "keys" conflicts with a Python keyword, hence the simple solution won't work
id_bpy_path = "bpy.data.shape_keys[\"%s\"]" % (ksp.id.name)
else:
idtype_list = ksp.id.bl_rna.name.lower() + "s"
id_bpy_path = "bpy.data.%s[\"%s\"]" % (idtype_list, ksp.id.name)