PDA

View Full Version : Time Configuration Options


FatAssasin
01-03-2004, 06:55 AM
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.

oatz
01-14-2004, 06:10 PM
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
)
)

FatAssasin
01-16-2004, 06:23 PM
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.

oatz
01-22-2004, 10:35 PM
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

FatAssasin
01-23-2004, 12:08 AM
Hmmm, using a timer... That's just crazy enough to work!

I'll try it out. Thanks. :)

FatAssasin
01-23-2004, 12:51 AM
Works like a charm. You da man!

cenobyte
02-18-2005, 09:55 PM
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 :)

CGTalk Moderation
02-18-2006, 10:00 PM
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.