Bringing Shapekeys into the Action Editor?

Anyone know how to do this in 2.5/2.6? I know I could do it back in 2.49 where all I had to do was go to Action Editor, click Add New, done. Someone please help me out on this so I can mix shapekeys together for the game engine. Thank you.

Have you tried the Dopesheet window and select Shapekey Editor, add a new action and change the shapekey sliders

I did that, I know they show up in the shapekey editor but not in the action editor. I went to dopesheet window, selected shapepkey editor on the tab, click add new, changed the slider’s animation on the timeline and I went back to the action editor to add new action and I don’t see anything in the action editor window.

I remember the first time when I did this back in 2.49 it was confusing for me to understand on how to get shapekeys to become actions so I hope I’m not causing any trouble :frowning:

Alright I went to edit the action I made in action editor in the shapkey editor though when I go back to action editor to see if the shape action I made would move in the timeline it didn’t

Anything yet on this? I fixed my last post where I thought I had it but sadly I didn’t. Sorry about that.

As far as I know the only way to do it is to use bone as a shape key driver. And then the bone can be driven from Action editor.

I’m pretty sure it works this way.

The action editor has object context, ie the keys there are paths from the object that is selected. The action is object.animation_data.action. When you change an action in the action editor, this becomes the action for the selected object.

The shape keys values are keyed onto the mesh or curve or data part of the object and that is what the shape key editor shows. The action
object.data.shapekeys.animation_data.action
when you change an action here it goes onto the data part if it can have shape keys.

This is well illustrated by how the dopesheet is organised.

When I first used blender i used to stuff up here all the time with changing and editing actions in the action editor and seemingly losing them, or attaching them to the wrong object.

All that said, post an image of your dopesheet
EDIT:
Posted after ridix.
Another one is to use custom properties named after the shape keys on your object. Then use these to drive the shapes. You can then key them in the Action editor.

Here is a script that creates a custom property on your object for each shape key and adds a driver relation to the shapekey from each.


import bpy

context = bpy.context
scene = context.scene
object = context.object
mesh = object.data
shape_keys = mesh.shape_keys

frame = scene.frame_start
scene.frame_set(frame)
# dictionary of shape_key fcurves keyed by data_path
fcurve_dict = {}
for key, keyblock in shape_keys.key_blocks.items():
    if keyblock == shape_keys.key_blocks[0]:
        print("keyblock %s assumed Basis and ignored" % key)
        continue
    # create a custom property for the key
    rna = {}
    rna[key] =  {"name": key,
                "min": keyblock.slider_min,
                "max": keyblock.slider_max,
                "description": "Shape Key %s" % key,
                "soft_min": keyblock.slider_min,
                "soft_max": keyblock.slider_max,
                }
    object[key] = keyblock.value
    object["_RNA_UI"] = rna
    
    # add a driver
    
    fcurve = shape_keys.driver_add('key_blocks["%s"].value' % key)
    driver = fcurve.driver
    driver.type = 'SCRIPTED'
    driver.expression = "shape"
    var = driver.variables.new()
    var.name = "shape"
    var.type = 'SINGLE_PROP'
    target = var.targets[0]
    target.id_type = "OBJECT"
    target.id = object.id_data
    target.data_path = '["%s"]' % key




.
Select the object that has the shape keys, then run the script from the text editor. Save first.

I do apologize if the image is a bit big but this is pretty much what I’m trying to achieve. Also I tried out your script and I’m-a bit confuzed with it. I saved it like you said. I set up like a simple shape animation in the shapekey editor, ran the script you gave me, clicked add new in the action editor and see nothing under the dopesheet summary.

Oh Ok. must have explained poorly the last time. To quote Foghorn Leghorn

You’re way off, I say you’re way off this time son!

I have modified the script slightly to add the custom properties to either the object with the mesh that has shapekeys, or to another obect, I’m assuming armature.

To use.

For props on mesh object with shape keys. Select the object run the script.
If you want the props on another object, select that object, then shift select the shape_key object and run.

What you get is custom properties on the object that drive the shape keys of the mesh with shape keys. If you key these in they will be in the action editor. I have keyed in a sample animation.

I haven’t bothered to transfer an existing animation from the shapekey values to the custom property. Once the driver system is set up you just key in the property. Hoping the example will explain it better.

Attachments

shape_key_drivers_to_another_object.blend (84.6 KB)

Okay, so do I make a shapkey animation on the cube, shift select the armature, the run the script?

No,

1 make the shapes on Cube
2. object mode

Do 3 and 4 if you want props on armature object

  1. select the armature
    4 shift select cube

5 run the script.

What the script does is adds custom properties to the object (object level properties, when keyed, show in the action editor) named after the shapekeys on the mesh. A driver relation is set up between the props and the shapes.

In the example i posted, look for the custom properties on the armature, (Look at the custom properties panel, object tab on the properties window.) Shape1, Shape2 … changing these will change their respective shape.

You only need to run the script once you have the shapekeys set up. Once run you will have a set of properties on the object, named after the shapes. Key in the custom properties to make your shape animation. Once you get it, you’ll get it… i’m finding it difficult to explain.