[Closed] run script in each frame
Hi,
I try to store postion of the camera in the text file. At this stage script writes down the values only for the one frame. How can I loop the script to go through my whole timeline and how can I append values to appear each in the new line?
outputFile = createFile “c:\cameraPosition.txt”
for obj in $ do
(
kuba = obj.pos.y * (-1)
posx = (obj.pos.x as string)
posy = (kuba as string)
posz = (obj.pos.z as string)
string = ” ” + posx + ” ” + posz + ” ” + posy
format string to:outputFile
)
close outputFile
thanks
kuba
outputFile = createFile "c:\\cameraPosition.txt"
for obj in selection do
for t = animationrange.start to animationrange.end do
at time t format "% % %
" obj.pos.x obj.pos.z -obj.pos.y to:outputFile
close outputFile
Hi, Bobo
Thank you now it works perfectly. The script at this moment stores all of my position coordinates of the camera for every frame in the text file. But I got stuck with rotation… I can’t figure it out how can I read rotation values of the object… Any clue would be very helpful.
Thank you very much
Kuba