PDA

View Full Version : How to Go To Frame?


Mike Truly
10-18-2009, 06:41 PM
A very basic question. What is the syntax to simply 'Go to Frame Whatever'?

For example, I want my script to always go to frame 0, then do the next instructions.

Thanks!

Mike Truly
10-18-2009, 06:45 PM
Ahhh... I think I found something that works. sliderTime=0

This is working as desired.

Thanks!

PEN
10-18-2009, 07:08 PM
You can use sliderTime to get and set the current time but you can also use currentTime to get the time. CurrentTime will work when Max is rendering and sliderTime will not. You can use animationRange to get the range as a range value and animationRange.start and .end to get and set the start and end values.

Mike Truly
10-18-2009, 07:53 PM
Thanks for the info Paul... I'm currently only trying to set the time to frame 0 and sliderTime seems the simplest for me.

Thanks again.

tarcus
10-19-2009, 09:14 AM
In most cases it also works to say:

at time 0
(
do this
and that...
)

Mike Truly
10-19-2009, 02:19 PM
Marcus,

Thanks for that.

I have realized that I need to do something slightly different than before. I need to:

1. Get the current frame.

2. Go to frame 0 (and do some other stuff)

3. Then go back to the original frame.

So I ended up using:

currentT=sliderTime
sliderTime=0
do stuff
sliderTime=currentT

Works great!

Thanks again.

Bobo
10-19-2009, 02:45 PM
Important:

Some features of Max actually require you to do the sliderTime setting. For example, in order to access correct PFlow info, it is necessary to use that.
Other features, for example getting the position of an object at a certain time, could be done inside the AT TIME context which does not change the scene time and thus does not cause a redraw of the viewports. Thus, it is generally faster to use the AT TIME as long as it works.

Mike Truly
10-20-2009, 07:41 AM
Good to know.... Thanks Bobo!

CGTalk Moderation
10-20-2009, 07:41 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.