I want to get the coordinates of joints of a skeleton. The following is the main code I used.
obj = bpy.context.object
obj_bone = bpy.context.object.data.bones
for f in range(scene.frame_start, scene.frame_end):
scene.frame_set(f)
verts = [obj.matrix_world @ obj_bone[i].head_local for i in range(31)]
But the coordinates of joints are the same between frames, seems the obj_bone only gets the coordinates in EDIT mode, how to get coordinates for all frames?
.pose.bonesinstead of.data.bonesyou get the position of the bones in pose mode. – Marty Fouts Oct 15 '21 at 03:50