Notifications
Clear all

[Closed] Time Configuration Options

Is there any way to select the Direction options in the Time Configuration Dialogue using MaxScript? I’ve looked up the Time Configuration options in the MaxScript Reference, but it only lists a limited number of the options that you can control through scripting, like the Playback Speed, Real Time Playback, etc. But it doesn’t show the commands for changing the Direction.

Basically, I want to be able to play an animation in reverse by pressing a button in a rollout. I can do something using a While or For loop and a command like “slidertime = slidertime – 1”, and then make it loop back to the end when it reaches the beginning of the trackbar. But then I don’t know how to get out of the loop besides pressing the Esc key and forcing the script to stop running. Not a very elligent solution.

Here’s the code I’m using now:

on anim_reverse pressed do
(
slidertime = animationRange.end
while slidertime > animationRange.start – 1 do
if slidertime == animationRange.start
then slidertime = animationRange.end
else slidertime = slidertime – 1
)

Any help would be appreciated. Thanks.

6 Replies

I’d use a checkbutton. Don’t have MAX available, so I don’t know if this works, but in theory its good:

(
checkbutton anim_reverse “Reverse”
on anim_reverse changed state do
(
if state ==on then
(
slidertime = animationRange.end
while slidertime > animationRange.start – 1 do
if slidertime == animationRange.start
then slidertime = animationRange.end
else slidertime = slidertime – 1
) else (
slidertime = currentTime
)
)

Thanks for the response. In theory that seems like it should work. I tried it and the problem is that while the script is in the “while” loop it doesn’t recognize any mouse clicks or key presses other than the “Esc” key.

I guess I could make the animation play from the end of the timeline to the beginning just once without looping back the end, but I’d rather have it loop back around.

Is there any way to make MaxScript not take over the program while it’s running through an endless loop? Or, is there a way to change the Direction option of the Time Configuration Dialogue through scripting? That would avoid the whole loop problem altogether.

this works:

rollout myrollout “Rollout”
(
checkbutton anim_reverse “Reverse”
timer mytimer interval: 33 active: false
on anim_reverse changed state do
(
mytimer.active = anim_reverse.state
print mytimer.active
)
on mytimer tick do
(
if slidertime <= animationRange.start do
(
slidertime = animationRange.end
)
slidertime -= 1
)
)

newfloater = newrolloutfloater “Something” 300 300 300 300
addrollout myrollout newfloater

Hmmm, using a timer… That’s just crazy enough to work!

I’ll try it out. Thanks.

Works like a charm. You da man!

I just started using Max last week, so forgive me if I’m posting in the wrong place. I found this script pretty helpful animating in reverse. Now, how do I get to render in reverse?

I went to Rendering>Time Output and couldn’t get Frames to go in reverse, as well. I’ve tried numbering 30-1 and get error message, “Render Error: This is not a valid frame number list” and I’ve tried hard-keying the numbers 30, 29, 28… and get an error message “Error Creating Q Time Stream”.

I supposed I can render each individual frame and merge them one-by-one, but is there an easier way (for Max 6)?

Thanks