I need to keyframe shape keys and have a script that's nicely working -
import bpy
frames = bpy.context.scene.frame_end + 1
for frame in range(frames):
for shapekey in bpy.data.shape_keys:
for i, keyblock in enumerate(shapekey.key_blocks):
if keyblock.name != 'Basis':
curr = i - 1
if curr != frame:
keyblock.value = 0
keyblock.keyframe_insert("value", frame=frame)
else:
keyblock.value = 1
keyblock.keyframe_insert("value", frame=frame)
The issue is, I need it to work only on the active object, not every object in the scene.
Anyone any pointers?