Wednesday, January 28, 2009

Floating Time - MaxScript

This script is great. I use a lot of custom scripts but none of them get as much use as this one, so I thought I'd share. It gives you a little floating window you can use to adjust the time range and go to any frame you like. I much prefer it to the default setup. Saves a few clicks and precisely 45milliseconds per frame change when you're working in 3DS Max. (Yes I'm being sarcastic, but it's still awesome and speeds you up in my opinion.) Fast is where it's at people!.

fn floatingTime =
(
   if (theTimeRollout != undefined)
   then (destroydialog theTimeRollout)

   rollout theTimeRollout "Floating Slider Time" width:258 height:25
   (
       spinner theStartFrame "Start: " pos:[22,4] width:60 range:[-100,50000,1] type:#integer
       edittext theTimeInput "Go To:" pos:[89,4] width:80
       spinner theEndFrame "End: " pos:[193,4] width:60 range:[-100,50000,1] type:#integer

       on theTimeRollout open do
       (
       theTimeInput.text = ((sliderTime as integer) / ticksperframe) as string
       theStartFrame.value = (animationRange.start as integer / ticksperframe)
       theEndFrame.value = (animationRange.end as integer / ticksperframe)
       )
       on theTimeInput entered x do
       (
       slidertime = x as integer
       )
       on theStartFrame changed x do
       (
       if (x < animationrange =" interval" value =" (animationRange.end" animationrange =" interval"> animationrange.start)
       then
       (
       animationRange = interval animationrange.start x
       )
       else
       (
       theEndFrame.value = (animationRange.start as integer / ticksperframe) + 1
       animationRange = interval animationrange.start theEndFrame.value
       )
   )
   )createDialog theTimeRollout style:#(#style_toolwindow, #style_sysmenu)

)

No comments: