View Full Version : How to Go To Frame?

Mike Truly
10 October 2009, 05: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.


Mike Truly
10 October 2009, 05:45 PM
Ahhh... I think I found something that works. sliderTime=0

This is working as desired.


10 October 2009, 06: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 October 2009, 06: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.

10 October 2009, 08:14 AM
In most cases it also works to say:

at time 0
do this
and that...

Mike Truly
10 October 2009, 01:19 PM

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:

do stuff

Works great!

Thanks again.

10 October 2009, 01:45 PM

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 October 2009, 06:41 AM
Good to know.... Thanks Bobo!

CGTalk Moderation
10 October 2009, 06: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.