Insert keyframe to multiple shapekeys

I need a python script to add a dummy keyframe to all shapekeys at one particular frame…
Pls anyone can help me…

1 Like

This will do it:

if hasattr(obj.data, "shape_keys"):
                        if hasattr(obj.data.shape_keys, "key_blocks"):
                            for shape in obj.data.shape_keys.key_blocks:
                                if (shape.name == key):
                                    shape.value = value
                                    obj.data.shape_keys.key_blocks[key].keyframe_insert("value", frame=framef)

This code is directly lifted from MultiKey, my Blender add-on that does exactly this and quite a bit more.

Thanks a lot

1 Like