I have imported a human model mesh, with armature and animated it with mocap. What I exactly need is the position of its eyes at different frames.
for f in frame_numbers:
eye_ob = bpy.data.objects[model+':Low-poly'] #eyes
ob = bpy.data.objects[model]
REyeIdx=95
LEyeIdx=47
scene.objects.active = eye_ob
scene.frame_set( f )
scene.update()
verts= eye_ob.data.vertices
print("right eyes ",verts[REyeIdx].co) #--this prints same value in all frames
print("left eyes ", verts[LEyeIdx].co) #--this prints same value in all frames
print("model pos" , ob.matrix_world.translation) #--this prints vector((0.0, 0.0, 0.0))
print("eye pos" , eye_ob.matrix_world.translation) #--this prints vector((0.0, 0.0, 0.0))
I am getting same 0,0,0 vector for object and its eye's positions. The coordinates of a specific vertex of eyes remains the same throughout the animation( not 0 vector). What could be the reason? How can I fix it? I saw related questions, but did not help.
matrix_world.to_translation()"should" work on empty. – batFINGER Mar 15 '17 at 12:52