0
$\begingroup$

I'm trying to access the Shape Key Editor via Python in Blender, but so far it doesn't work for me. I already know how to access the Action Editor via Python:

bpy.data.objects['rig'].animation_data_create()
bpy.data.objects['rig'].animation_data.action = bpy.data.actions["action_number"]

And I thought the Shape Key Editor might work the same, but it doesn't. Or at least I can't find the right code to do so.

I'm also aware that I can just use the direct way and set Keyframes like this:

bpy.data.shape_keys["Key"].key_blocks["shape_key_name"].value = 0
object_name.data.shape_keys.key_blocks["shape_key_name"].keyframe_insert("value",frame=0)

But this inserts "fixed" Keyframes that I have to delete every time I want to insert a new Shape Key-Keyframe at the same frame. So I thought the Shape Key Editor might be the solution, since it stores Keyframes like the Action Editor.

Does anyone know how to call upon a Shape Key Editor Action via Python in Blender API?

$\endgroup$

1 Answer 1

0
$\begingroup$

Current shape key action is in object_name.data.shape_keys.animation_data.action, which points to a normal Action object, same as for action editor. Only here the animation data is stored in fcurves with data_path values such as 'key_blocks["shape_key_name"].value'.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .