I’ve only a few days ago started to work with python in blender and I’m not a pro in programming, so please forgive if my problem is on a very basic level and my code looks dilettantish.
I’m trying to do something as simple as printing the location data of a moving camera at every frame within the framerange. I simplified the code to trace back the reason why this does not work and came up with this code:
import bpy i = 0 while i <= 250: bpy.context.scene.frame_current = i print (bpy.context.scene.frame_current) print (bpy.context.scene.camera.location) i = i + 1
To my amazement this script indeed prints the frame_current correct (it starts with 0, increases by 1 in every line and ends with 250), but the location data of the camera stays allways the same - namely the location values which the camera had before the script was started. Now i wonder why blender prints the frame_current correctly while it fails to print the camera.location at the respective frame.
This seems to have something to do with the “while” statement, as I tryed the same thing with a script that just goes to the next frame and prints the data - and the data was printed correctly then.
Thanks for any helping advice in advance.