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 / resetAll Script problem
  RSS 2.0 ATOM  

resetAll Script problem
Rate this thread
 
37795
 
Permlink of this thread  
avatar
  • _j.t._
  • Posted: 15 December 2009 04:56 AM
  • Total Posts: 33
  • Joined: 06 March 2008 09:10 PM

Hello,

I’m trying to set up a script for a basic rig I’ve done based on the Paul Neale rigging videos.
I would like to be able to set my slider controls and hit the “reset” button and it reset my spinners.
As of right now, I can set up my spinners and the interface with no issues, but getting the reset button to work is the problem
Thanks for any tips on this!
Below is what I have currently:

ca=attributes tubeControls

(
parameters tubeP rollout:tubeR
(
tube type:#float uitubeSp,tubeSl)
)
rollout tubeR “tube Controls”
(
spinner tubeSp “” range:[-200,200,0]
slider tubeSl “tube” range:[-200,200,0] offset:[0,-20]

)

parameters ResetP rollout:ResetR
(
ResetAll type:#integer uiR_ResetBtn)
)
rollout ResetR “Reset”
(
button R_ResetBtn “Reset” enabled:true toolTip:"tube to 0”
on resetAll pressed do
(
#(tubeSp).value = 0
)
)
)



Replies: 0
avatar
  • Anubis
  • Posted: 15 December 2009 09:21 AM

First I dont understand why you put spinner into array in this case, but more important here is why you put your reset button into separate rollout. Of course you can, but is this necessary? Moreover, is not even necessary to define this button in the parameter block. Shortly, if the button (ResetAll) is in the same rollout with the spinner (tubeSp) then the button handle will be simple, just…

tubeSp.value 0

...else - (if needed to be into separate rollout) need to call the spinner rollout owner, ie:

tubeR.tubeSp.value 0


Max 9 through 2009, XP-Pro x64 SP2
ASUS EAH3450 Series (Driver 8.470).
Core 2 Duo E8400 3GHz, 4Gb Ram, DX9.0c.

Replies: 1
/img/forum/dark/default_avatar.png

Hi Anubis,

Thanks for the response.  As mentioned, I’ve been working through the Paul Neale Rigging videos, and there’s a step which he shows you how to rig fingers.  I’m currently learning scripting and rigging, which I’m enjoying a lot :)
With that said, I was trying to mix a little of what the video shows with some stuff I’ve found through reading the maxscripts help file, which are tough btw.
But, if I’m understanding correctly, I can type the rollout portion like below:

(
spinner tubeSp “” range:[-200,200,0]
slider tubeSl “tube” range:[-200,200,0] offset:[0,-20]

button R_ResetBtn “Reset” enabled:true toolTip:"tube to 0”
on resetAll pressed do
tubeSp.value=0
)

Author: _j.t._

Replied: 16 December 2009 02:24 AM  
avatar
  • Anubis
  • Posted: 16 December 2009 08:22 AM

Yes, of course you can :)

Note: I see you renamed the button from resetAll to R_ResetBtn so fix the name for the button handle as well (on R_ResetBtn pressed do).



Max 9 through 2009, XP-Pro x64 SP2
ASUS EAH3450 Series (Driver 8.470).
Core 2 Duo E8400 3GHz, 4Gb Ram, DX9.0c.

Replies: 1
/img/forum/dark/default_avatar.png

Hey there!  Your tips helped immensely!!  I’m doing cartwheels in my skin cause I finally got this to work!  I’m on a nerd high right now :)
Thanks again for the help!

Author: _j.t._

Replied: 17 December 2009 02:36 AM