I've created an object that has a few shape keys that have keyframes inserted. I've made a script that moves keyframes for shapekeys, but I can't get it to work for individual shape keys ones. Instead, the script moves the keyframes for all of the shapekeys in the scene. Does any one have an idea of how to get a specific objects keyframes moved?
for key in bpy.data.shape_keys: if key.animation_data is not None: action = key.animation_data.action if action is not None: for fc in action.fcurves: for kf in fc.keyframe_points: kf.co.x += 90
Let's say I have a key named "Key 2" and I want the keyframes for only that shape key to be affected. This script simply doesn't function to do so.
I've searched and tried many methods including using lists or variables like this (to only alter the shape key of a selected object):
ob = bpy.context.scene.objects sel_shape_keys = ob.active.data.shape_keys for key in sel_shape_keys: if key.animation_data is not None: action = key.animation_data.action if action is not None: for fc in action.fcurves: for kf in fc.keyframe_points: kf.co.x += 90
but I get error messages every time. I'll admit that I'm a bit new to working with keyframes in Blender's Python API - any help with this would be greatly appreciated as I'm stumped in solving the issue.