View Full Version : run script in each frame

04 April 2006, 01:48 PM

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



04 April 2006, 08:10 PM
outputFile = createFile "c:\\cameraPosition.txt"
for obj in selection do
for t = animationrange.start to animationrange.end do
at time t format "% % %\n" obj.pos.x obj.pos.z -obj.pos.y to:outputFile
close outputFile

04 April 2006, 12:29 AM
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

CGTalk Moderation
04 April 2006, 12:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.