I have a animation where one object moves through the 3D space. How can I get the location of this object which it has at a specific frame?
I tried something like this:
obj = bpy.context.active_object
ol = obj.location
# set current frame to 1
bpy.context.scene.frame_current = 1
pos_1 = (ol.x, ol.y, ol.z)
# set current frame to 5
bpy.context.scene.frame_current = 5
pos_5 = (ol.x, ol.y, ol.z)
# set current frame to 10
bpy.context.scene.frame_current = 10
pos_10 = (ol.x, ol.y, ol.z)
# set current frame back to 1
bpy.context.scene.frame_current = 1
print('Frame 1 {0}, id: {1}'.format(pos_1, id(pos_1)))
print('Frame 5 {0}, id: {1}'.format(pos_5, id(pos_5)))
print('Frame 10 {0}, id: {1}'.format(pos_10, id(pos_10)))
But the output for all Frames is the same except for the id's. So, how can I get the position of an object at a specific frame?