Notifications
Clear all

[Closed] noob question

Hey guys just a really simple question

If I wanted to turn off a modifier from my stack how would it do it?

Not delete it,

Like if I wanted to be able to turn Off an On lets say the edit mesh of an object.

Thanks in advance

9 Replies

Hi.

To disable the modifier on the top of the stack of modifiers for the selected object:

$.modifiers[1].enabled = false

Thanks that helped

I have another question, I’ve created 2 buttons on enables the turbosmooth of my object and the other one disables it. It works fine, but now I can’t tell which one I have pressed. How can I make the button so that it stays pressed?
Here my noob script

rollout turbosmooth “TURBO SMOOTH”

(

 button turbosmooth "ON" across:2

on turbosmooth pressed do



 (

      $Orcbody01.modifiers[#TurboSmooth].enabled=true

 ) 



 button meshsmootha "OFF"

on meshsmootha pressed do

 (

      $Orcbody01.modifiers[#TurboSmooth].enabled=false

 )

)

Hi,

Use a checkbutton like this:

on cb checked pState do selection.modifiers[#TurboSmooth].enabled = pState

Light

whats the pState stand for. it doesnt work for me but i think is because i don’t know what the pState is supposed to do

1 Reply
(@erilaz)
Joined: 11 months ago

Posts: 0

The state is a boolean, ie. true or false. This is all spelled out quite clearly in the max reference. Look under checkbox. True means the box is checked (on), false means it isn’t checked (off).

Yeah Martin is right. It’s just a variable that holds the current parameter state, hence my use of pState.

Light

thanks for the help guys

Hey guys I’ve created my first scripted toolbar for a specific character. And I really just want some advice
im pretty new at scripting. Just want some comments on this, thanks
I know the script is very name dependent
And for some reason I couldn’t get the checkboxes to work so that’s why I used so many buttons. It works for what i need it to do,but here my first attemp i really need some feed back.

[color=#eeefeb]

[/color]


Macroscript Firstgoodattempt
 
category:"My Scripts"
 

 
( 
 
rollout toolsetorc "Orc ToolBar"
 
(
 
group "ANIMATION BONES"
 
(
 
button polyOn "ON" across:2
 
button polyOff "OFF"
 
)
 
group "MESH"
 
(
 
button Hidemesh "HIDE" across:2
 
button Hidemeshs "UNHIDE" 
 
Checkbox turbocb "Turbosmooth" 
 
)
 
group " HIDE UNHIDE" 
 
(
 
button eyes "Eyes" align:#left width:60 height:25
 
button hteeth "Teeth" align:#left width:60 height:25
 
button chartr "Character" align:#left width:60 height:25
 
button ctrlrs "CTRLs" align:#left width:60 height:25
 
button Fctrlrs "Face CTRLs" align:#left width:60 height:25
 
 
 
button heyes "Eyes" align:#right width:60 height:25 offset:[0,-150]
 
button teeth "Teeth" align:#right width:60 height:25
 
button chartrs " Character" align:#right width:60 height:25
 
button ctrlrd "CTRLs" align:#right width:60 height:25
 
button Fctrlrd "Face CTRLs" align:#right width:60 height:25
 
)
 
group "Spring Dynamics"
 
(
 
button springa "0" across:3
 
button springs "1"
 
button springss "2"
 
)
 
 
 
on turbocb changed pState do
 
(
 
$Orcbody01.modifiers[#TurboSmooth].enabled=pState
 
)
 
on Hidemesh pressed do 
 
(
 
Hide $Orcbody01
 
)
 
on Hidemeshs pressed do
 
(
 
UnHide $Orcbody01
 
)
 
on PolyOn pressed do
 
(
 
$Bone_LlegR.modifiers[#Edit_Poly].enabled=true
 
$Bone_AnkleR.modifiers[#Edit_Poly].enabled=true
 
$Bone_UlegR.modifiers[#Edit_Poly].enabled=true
 
$Bone_PELVIS.modifiers[#Edit_Poly].enabled=true
 
$BELLY.modifiers[#Edit_Poly].enabled=true
 
$Bone_UlegL.modifiers[#Edit_Poly].enabled=true
 
$Bone_LlegL.modifiers[#Edit_Poly].enabled=true
 
$Bone_AnkleL.modifiers[#Edit_Poly].enabled=true
 
$Bone_bigToeR.modifiers[#Edit_Poly].enabled=true
 
$Bone_Toe01R.modifiers[#Edit_Poly].enabled=true
 
$Bone_Toe02R.modifiers[#Edit_Poly].enabled=true
 
$Bone_Toe03R.modifiers[#Edit_Poly].enabled=true
 
$Bone_bigToeL.modifiers[#Edit_Poly].enabled=true
 
$Bone_Toe01L.modifiers[#Edit_Poly].enabled=true
 
$Bone_Toe02L.modifiers[#Edit_Poly].enabled=true
 
$Bone_Toe03L.modifiers[#Edit_Poly].enabled=true
 
$Bone_Spine02.modifiers[#Edit_Poly].enabled=true
 
$Bone_Spine03.modifiers[#Edit_Poly].enabled=true
 
$Bone_Spine04.modifiers[#Edit_Poly].enabled=true
 
$Bone_Spine05.modifiers[#Edit_Poly].enabled=true
 
$Bone_Neck.modifiers[#Edit_Poly].enabled=true
 
$Bone_Head.modifiers[#Edit_Poly].enabled=true
 
$Uarm_twistR.modifiers[#Edit_Poly].enabled=true
 
$Bone_UarmR.modifiers[#Edit_Poly].enabled=true
 
$Uarm_twistL.modifiers[#Edit_Poly].enabled=true
 
$Bone_UarmL.modifiers[#Edit_Poly].enabled=true
 
$Bone_LarmR.modifiers[#Edit_Poly].enabled=true
 
$TB1.modifiers[#Edit_Poly].enabled=true
 
$TB2.modifiers[#Edit_Poly].enabled=true
 
$TB3.modifiers[#Edit_Poly].enabled=true
 
$TB4.modifiers[#Edit_Poly].enabled=true
 
$Bone_LarmL.modifiers[#Edit_Poly].enabled=true
 
$TB08.modifiers[#Edit_Poly].enabled=true
 
$TB07.modifiers[#Edit_Poly].enabled=true
 
$TB06.modifiers[#Edit_Poly].enabled=true
 
$TB05.modifiers[#Edit_Poly].enabled=true
 
$Bone_HandR.modifiers[#Edit_Poly].enabled=true
 
$Pincky01.modifiers[#Edit_Poly].enabled=true
 
$Thumb01.modifiers[#Edit_Poly].enabled=true
 
$Thumb02.modifiers[#Edit_Poly].enabled=true
 
$Thumb03.modifiers[#Edit_Poly].enabled=true
 
$Index01.modifiers[#Edit_Poly].enabled=true
 
$Index02.modifiers[#Edit_Poly].enabled=true
 
$Index03.modifiers[#Edit_Poly].enabled=true
 
$Midle01.modifiers[#Edit_Poly].enabled=true
 
$Midle02.modifiers[#Edit_Poly].enabled=true
 
$Midle03.modifiers[#Edit_Poly].enabled=true
 
$Pincky02.modifiers[#Edit_Poly].enabled=true
 
$Pincky03.modifiers[#Edit_Poly].enabled=true
 
$Pincky04.modifiers[#Edit_Poly].enabled=true
 
$Bone_HandL.modifiers[#Edit_Poly].enabled=true
 
$Thumb01L.modifiers[#Edit_Poly].enabled=true
 
$Thumb02L.modifiers[#Edit_Poly].enabled=true
 
$Thumb03L.modifiers[#Edit_Poly].enabled=true
 
$pincky01L.modifiers[#Edit_Poly].enabled=true
 
$Index01L.modifiers[#Edit_Poly].enabled=true
 
$Index02L.modifiers[#Edit_Poly].enabled=true
 
$Index03L.modifiers[#Edit_Poly].enabled=true
 
$Midle01L.modifiers[#Edit_Poly].enabled=true
 
$Midle02L.modifiers[#Edit_Poly].enabled=true
 
$Midle03L.modifiers[#Edit_Poly].enabled=true
 
$pincky02L.modifiers[#Edit_Poly].enabled=true
 
$pincky03L.modifiers[#Edit_Poly].enabled=true
 
$pincky04L.modifiers[#Edit_Poly].enabled=true
 
)
 
on PolyOff pressed do
 
(
 
$Bone_LlegR.modifiers[#Edit_Poly].enabled=false
 
$Bone_AnkleR.modifiers[#Edit_Poly].enabled=false
 
$Bone_UlegR.modifiers[#Edit_Poly].enabled=false
 
$Bone_PELVIS.modifiers[#Edit_Poly].enabled=false
 
$BELLY.modifiers[#Edit_Poly].enabled=false
 
$Bone_UlegL.modifiers[#Edit_Poly].enabled=false
 
$Bone_LlegL.modifiers[#Edit_Poly].enabled=false
 
$Bone_AnkleL.modifiers[#Edit_Poly].enabled=false
 
$Bone_bigToeR.modifiers[#Edit_Poly].enabled=false
 
$Bone_Toe01R.modifiers[#Edit_Poly].enabled=false
 
$Bone_Toe02R.modifiers[#Edit_Poly].enabled=false
 
$Bone_Toe03R.modifiers[#Edit_Poly].enabled=false
 
$Bone_bigToeL.modifiers[#Edit_Poly].enabled=false
 
$Bone_Toe01L.modifiers[#Edit_Poly].enabled=false
 
$Bone_Toe02L.modifiers[#Edit_Poly].enabled=false
 
$Bone_Toe03L.modifiers[#Edit_Poly].enabled=false
 
$Bone_Spine02.modifiers[#Edit_Poly].enabled=false
 
$Bone_Spine03.modifiers[#Edit_Poly].enabled=false
 
$Bone_Spine04.modifiers[#Edit_Poly].enabled=false
 
$Bone_Spine05.modifiers[#Edit_Poly].enabled=false
 
$Bone_Neck.modifiers[#Edit_Poly].enabled=false
 
$Bone_Head.modifiers[#Edit_Poly].enabled=false
 
$Uarm_twistR.modifiers[#Edit_Poly].enabled=false
 
$Bone_UarmR.modifiers[#Edit_Poly].enabled=false
 
$Uarm_twistL.modifiers[#Edit_Poly].enabled=false
 
$Bone_UarmL.modifiers[#Edit_Poly].enabled=false
 
$Bone_LarmR.modifiers[#Edit_Poly].enabled=false
 
$TB1.modifiers[#Edit_Poly].enabled=false
 
$TB2.modifiers[#Edit_Poly].enabled=false
 
$TB3.modifiers[#Edit_Poly].enabled=false
 
$TB4.modifiers[#Edit_Poly].enabled=false
 
$Bone_LarmL.modifiers[#Edit_Poly].enabled=false
 
$TB08.modifiers[#Edit_Poly].enabled=false
 
$TB07.modifiers[#Edit_Poly].enabled=false
 
$TB06.modifiers[#Edit_Poly].enabled=false
 
$TB05.modifiers[#Edit_Poly].enabled=false
 
$Bone_HandR.modifiers[#Edit_Poly].enabled=false
 
$Pincky01.modifiers[#Edit_Poly].enabled=false
 
$Thumb01.modifiers[#Edit_Poly].enabled=false
 
$Thumb02.modifiers[#Edit_Poly].enabled=false
 
$Thumb03.modifiers[#Edit_Poly].enabled=false
 
$Index01.modifiers[#Edit_Poly].enabled=false
 
$Index02.modifiers[#Edit_Poly].enabled=false
 
$Index03.modifiers[#Edit_Poly].enabled=false
 
$Midle01.modifiers[#Edit_Poly].enabled=false
 
$Midle02.modifiers[#Edit_Poly].enabled=false
 
$Midle03.modifiers[#Edit_Poly].enabled=false
 
$Pincky02.modifiers[#Edit_Poly].enabled=false
 
$Pincky03.modifiers[#Edit_Poly].enabled=false
 
$Pincky04.modifiers[#Edit_Poly].enabled=false
 
$Bone_HandL.modifiers[#Edit_Poly].enabled=false
 
$Thumb01L.modifiers[#Edit_Poly].enabled=false
 
$Thumb02L.modifiers[#Edit_Poly].enabled=false
 
$Thumb03L.modifiers[#Edit_Poly].enabled=false
 
$pincky01L.modifiers[#Edit_Poly].enabled=false
 
$Index01L.modifiers[#Edit_Poly].enabled=false
 
$Index02L.modifiers[#Edit_Poly].enabled=false
 
$Index03L.modifiers[#Edit_Poly].enabled=false
 
$Midle01L.modifiers[#Edit_Poly].enabled=false
 
$Midle02L.modifiers[#Edit_Poly].enabled=false
 
$Midle03L.modifiers[#Edit_Poly].enabled=false
 
$pincky02L.modifiers[#Edit_Poly].enabled=false
 
$pincky03L.modifiers[#Edit_Poly].enabled=false
 
$pincky04L.modifiers[#Edit_Poly].enabled=false
 
)
 
on eyes pressed do 
 
(
 
hide #($pupil, $iris, $'L eyeball', $'L eyeball01', $pupil01, $iris01, $'EYE CTRL', $Text01, $Text02)
 
)
 
on heyes pressed do
 
(
 
unhide #($pupil, $iris, $'L eyeball', $'L eyeball01', $pupil01, $iris01, $'EYE CTRL', $Text01, $Text02)
 
)
 
on hteeth pressed do 
 
(
 
hide #($Box50, $Box42, $Box41, $Box40, $Box39, $Box25, $Box38, $Box37, $Box02, $Box03, $Box22, $Box04, $Box05, $Box06, $Box07, $Box24, $Box51, $Box47, $Box49, $Box48, $Box46, $Box44, $Box45, $Box17, $Box16, $Box15, $Box21, $Box23, $Box01, $Box36, $'Bottom Teeth', $'Top Teeth')
 
)
 
on teeth pressed do
 
(
 
unhide #($Box50, $Box42, $Box41, $Box40, $Box39, $Box25, $Box38, $Box37, $Box02, $Box03, $Box22, $Box04, $Box05, $Box06, $Box07, $Box24, $Box51, $Box47, $Box49, $Box48, $Box46, $Box44, $Box45, $Box17, $Box16, $Box15, $Box21, $Box23, $Box01, $Box36, $'Bottom Teeth', $'Top Teeth')
 
)
 
on chartr pressed do
 
(
 
hide $Character01
 
)
 
on chartrs pressed do
 
(
 
unhide $Character01
 
)
 
on ctrlrs pressed do
 
(
 
hide #($'Foot Control R', $'Foot Control L', $'CTRL Clavicle L', $'CTRL Fingers L', $'CTRL Clavicle R', $'CTRL Fingers R', $'CTRL Independent Head ', $'CTRL Neck', $Circle05, $'CTRL Ear01', $Circle04, $'CTRL Ear', $Circle01, $'CTRL Hand L', $'CTRL Hand R', $'CTRL Waist', $'CTRL Pelvis', $'CTRL L Spine', $'CTRL U Spine', $'CTRL Elbow R', $'CTRL Elbow L')
 
)
 
on ctrlrd pressed do
 
(
 
unhide #($'Foot Control R', $'Foot Control L', $'CTRL Clavicle L', $'CTRL Fingers L', $'CTRL Clavicle R', $'CTRL Fingers R', $'CTRL Independent Head ', $'CTRL Neck', $Circle05, $'CTRL Ear01', $Circle04, $'CTRL Ear', $Circle01, $'CTRL Hand L', $'CTRL Hand R', $'CTRL Waist', $'CTRL Pelvis', $'CTRL L Spine', $'CTRL U Spine', $'CTRL Elbow R', $'CTRL Elbow L')
 
)
 
on Fctrlrs pressed do
 
(
 
hide #($FaceControl12, $Rectangle02, $FaceControl05, $FaceControlHandle05, $Text07, $FaceControl06, $FaceControlHandle06, $Text08, $FaceControl07, $FaceControlHandle07, $Text09, $FaceControl08, $FaceControlHandle08, $Text10, $FaceControl04, $FaceControlHandle04, $Text06, $Rectangle03, $FaceControl10, $Text11, $FaceControlHandle10, $Text16, $FaceControl11, $FaceControlHandle11, $Text13, $Text15, $Text20, $FaceControlHandle12, $Text14, $FaceControl09, $FaceControlHandle09, $Text12, $FaceControl14, $FaceControlHandle14, $Text19, $FaceControl13, $FaceControlHandle13, $Text18, $Rectangle01, $FaceControl02, $FaceControlHandle02, $Text04, $FaceControl03, $FaceControlHandle03, $Text05, $FaceControl01, $FaceControlHandle01, $Text03, $Text17, $Rectangle05, $FaceControl15, $FaceControlHandle15, $Rectangle04)
 
)
 
on Fctrlrd pressed do
 
(
 
unhide #($FaceControl12, $Rectangle02, $FaceControl05, $FaceControlHandle05, $Text07, $FaceControl06, $FaceControlHandle06, $Text08, $FaceControl07, $FaceControlHandle07, $Text09, $FaceControl08, $FaceControlHandle08, $Text10, $FaceControl04, $FaceControlHandle04, $Text06, $Rectangle03, $FaceControl10, $Text11, $FaceControlHandle10, $Text16, $FaceControl11, $FaceControlHandle11, $Text13, $Text15, $Text20, $FaceControlHandle12, $Text14, $FaceControl09, $FaceControlHandle09, $Text12, $FaceControl14, $FaceControlHandle14, $Text19, $FaceControl13, $FaceControlHandle13, $Text18, $Rectangle01, $FaceControl02, $FaceControlHandle02, $Text04, $FaceControl03, $FaceControlHandle03, $Text05, $FaceControl01, $FaceControlHandle01, $Text03, $Text17, $Rectangle05, $FaceControl15, $FaceControlHandle15, $Rectangle04)
 
)
 
on springa pressed do
 
(
 
$Point57.pos.controller[#Spring].steps=0
 
$Point86.pos.controller[#Spring].steps=0
 
)
 
on springs pressed do
 
(
 
$Point57.pos.controller[#Spring].steps=1
 
$Point86.pos.controller[#Spring].steps=1
 
)
 
on springss pressed do
 
(
 
$Point57.pos.controller[#Spring].steps=2
 
$Point86.pos.controller[#Spring].steps=2
 
)
 
 
 
)
 
 
 
createDialog toolsetorc style:#(#style_titlebar, #style_border, #style_sysmenu, #style_toolwindow)
)
 

Hi

to use a checkBox instead of a button, you can use the .isHidden property of an object

example:

– …
checkBox eyes “Eyes”
– …
on eyes changed state do – here I use ‘state’ but you can use whatever name you want
(
eyesobj=#($pupil, $iris, $‘L eyeball’, $‘L eyeball01’, $pupil01, $iris01, $‘EYE CTRL’, $Text01, $Text02)
for o in eyesobj do o.ishidden=state
)