I want to apply and keyframe a pose asset. The first part of applying a pose was described in this answer. However, I am not sure how to keyframe the action.

This is my code:

def apply_pose(frame, pose):
    win = bpy.context.window
    scr = win.screen
    area = scr.areas[0]
    area.type = "DOPESHEET_EDITOR"e

    with bpy.context.temp_override(area=area):
        bpy.data.objects['DeOne'].animation_data.action = bpy.data.actions[pose]
        for i in bpy.context.selected_objects[0].data.bones:
             i.select = True


I also tried bpy.ops.action.keyframe_insert() and bpy.ops.anim.keyframe_insert_by_name(type="BUILTIN_KSI_BendyBones")

Thank you for your help.


1 Answer 1


I am not a coder but use it for speech animation quite a bit. Have you tried the last line: bpy.ops.anim.keyframe_insert_menu(type='LocRotScale') it works in most instances for me.


You must log in to answer this question.

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