1

I have found this answer, but it works not inside animation handler. Is it possible to get and print object locations (xyz) from animation handler (frame_change_pre) ?

def my_handler(scene):
    ob = bpy.data.objects["ob_1"]
    pos = ob.location
    print(pos)

bpy.app.handlers.frame_change_pre.append(my_handler)

In example above location didn't changed from frame to frame.

Dmitry
  • 111
  • 2
  • 1
    Your code works for an object called "ob_1" and a keyframed location. Do you use a driver or e.g. an armature that changes the translation of the object? If so, use ob.matrix_world.translation instead. – CodeManX Nov 02 '14 at 22:17
  • yes, object ob_1 works in animation and keyframed by location. ob.matrix_world.translation shows location with different Z locations from frame to frame as expected. Many thanks – Dmitry Nov 02 '14 at 22:26

0 Answers0