Notifications
Clear all

[Closed] How to Go To Frame?

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!

7 Replies

Ahhh… I think I found something that works. sliderTime=0

This is working as desired.

Thanks!

 PEN

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.

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.

In most cases it also works to say:

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

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.

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.

Good to know… Thanks Bobo!