Title says it all. Typing “bpy.ops.pose.transforms_clear()” (without the quotes) into the Python console resets selected bones to rest position. But running it in the script it doesn’t. I want a script that puts a rest pose keyframe for the armature at frame 0. The script sets the frame to 0 (bpy.context.scene.frame_current = 0), selects all bones (bpy.ops.pose.select_all(action=‘TOGGLE’)) and the next line is the above which does nothing. What am I missing?
What I am missing is adding the keyframe. I was testing to make sure that the pose would reset. When I added the line, “bpy.ops.anim.keyframe_insert_menu(type=‘LocRotScale’)” (without quotes) the rest post was keyframed and saved.