I'm trying to export animation data, but my bones never get updated from keyframe to keyframe. This is how I iterate over my actions and keyframes:
for action in bpy.data.actions:
armature.animation_data.action = action
bpy.ops.screen.frame_jump(0)
bpy.context.scene.update()
while {'FINISHED'} == bpy.ops.screen.keyframe_jump():
bpy.context.scene.update()
for boneName in bones_index:
bone = armature.pose.bones[boneName]
mat = glob_mat * mathutils.Matrix(bone.matrix)
The 'mat' variable is the bone matrix for each bone. Per frame, the 'mat' variable doesn't seem to change. For example, if I only look at the bone "Leg", the leg pose matrix doesn't seem to change keyframe to keyframe. The matrix is the correct matrix for frame 0, and it is different from my base pose. Am I not getting the pose matrices correctly? Or am I not correctly changing the scene? In the blender console, bpy.ops.screen.keyframe_jump() does exactly what I want, so I don't think that's the issue.
http://blender.stackexchange.com/questions/8387/how-to-get-keyframe-data-from-python
– MarcClintDion Apr 12 '14 at 18:33