I've found that the default Keying set that Blender exports from the Keying Set Panel, when you have shape keys added to the keyset - will pull the following error and be useless for importing keysets into new scenes:
! |
TypeError: 'builtin_function_or_method' object is not subscriptable Error: Python script fail, look in the console for now... |
# Keying Set: KeyingSet
import bpy
scene = bpy.context.scene
# Keying Set Level declarations
ks = scene.keying_sets.new(idname="KeyingSet", name="Keyset_Name")
ks.bl_description = ""
ks.use_insertkey_needed = False
ks.use_insertkey_visual = False
ks.use_insertkey_xyz_to_rgb = True
# ID's that are commonly used
## This is the default in blender, and it is broken.
#id_0 = bpy.types.key["Key"]
### Use this instead:
id_0 = bpy.context.object.data.shape_keys
# Path Definitions
ksp = ks.paths.add(id_0, 'key_blocks["Shape_Name"].value', index=-1)