Time Control

The following methods and 3ds max system global variables are associated with the 3ds max Time Controls:

animButtonEnabled

A Boolean value that specifies whether the user can change the state of the Animate button. If set to false, the user can not change the Animate button state. If set to true, the user can change the Animate button state. A script can change the state of the Animate button using animButtonState regardless of the animButtonEnabled value.

animButtonState

Lets you to get and set the state of the Animate button. A Boolean value - true if Animate is on, false if Animate is off.

sliderTime

Lets you get and set a Time value that defines the time associated with the 3ds max time slider.

Two functions are provided for starting and stopping the 3ds max animation playback, which are essentially equivalent to pressing the Play button in the 3ds max user interface. The functions are:

playAnimation [ #selOnly ]

stopAnimation()

If you specify the optional argument, #selOnly, to playAnimation()only the currently selected objects are animated.

There is an important restriction to understand when using these functions:

Calling playAnimation() is a thread-blocking call internally in 3ds max and does not return until the playback is stopped by the user clicking the Stop Play button or another thread executing a stopAnimation(). The only way to achieve the latter in MAXScript currently is to call stopAnimation() from a scripted rollout panel handler such as a button press handler or from a scripted controller script. If you invoke playAnimation() in code run from the Listener, you will not be able to invoke stopAnimation() from the Listener, because the Listener is blocked inside the playAnimation() call.

Also see Time Configuration Dialog for methods for setting options in the Time Configuration dialog.