Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / undo spinner value
  RSS 2.0 ATOM  

undo spinner value
Rate this thread
 
63237
 
Permlink of this thread  
avatar
  • jpepper
  • Posted: 03 January 2012 05:46 AM
  • Total Posts: 40
  • Joined: 07 July 2011 04:58 PM

Is there a way to just use the undo ControlZ to undo a spinner value?
Of course I mean in a maxscript that has a spinner.



max2010-2012 windows xp64bit
nvidia QuadroFX

Replies: 0
avatar

Generally you should just be able to wrap your spinner changed function call with an undo scope.

on spinner changed do (
  
with undo on (
    function()
  )
)


Randall Hess
Senior Technical Animator
THQ, Volition Inc.

Replies: 0
avatar
  • jpepper
  • Posted: 03 January 2012 10:51 AM

Thanks for the fast.  I do see how you can just wrap up the functions into an UNDO like that.
However, I was just curious if there was a way to just do a simple “UNDO” of the spinner value.
Just like in max if I change a spinner, then undo the spinner value will go back to the last value.

Of course the spinner is tied to something so it changes more than just the user input value.

Here’s a simple bit of code:

try (destroydialog Base_Roll) catch()
rollout Base_Roll "Title HERE" 
 
(
 
spinner spn01 "SPINME"

 
on spn01 changed val do 
 (
 
with undo on 
 
(
 print 
spn01.value as string
 
)
 )

createDialog Base_Roll 200 200

I’m just wondering if you can use the UNDO to just change the spinner value back to the last value.  This doesn’t make any sense to have the spinner print the value but I’m just curious how you’d be able to make the UNDO command know to go back to the last spinner value.  Do you have to capture the current spinner value in some varable and store it and then hopefully the UNDO command would recall it.

Thanks for the help so far.



max2010-2012 windows xp64bit
nvidia QuadroFX

Replies: 0
avatar

I believe the easiest thing to do here is assign your spinner a controller. That way it can actively track the value changes.

spinner spn01 "SPINME" controller:(bezier_float())


Randall Hess
Senior Technical Animator
THQ, Volition Inc.

Replies: 0
avatar
  • jpepper
  • Posted: 03 January 2012 02:44 PM

Yes you are correct that is the way to go.
I guess I was just over thinking it.  Either way this is good information.

Thank you!



max2010-2012 windows xp64bit
nvidia QuadroFX

Replies: 0