r/Maxscript • • Mar 30 '21
Disable Buttons
Is it possible to use maxscript to deactivate previously active buttons when no object is selected?
https://reddit.com/link/mgfzkk/video/4rpogm6g26q61/player
on bt_head changed state do
(
if bt_head.checked == true then
(
selectmore $Farlee_pelvis_torso_spine1_Ctrl
)
else if bt_head.checked == false then
(
deselect $Farlee_pelvis_torso_spine1_Ctrl
)
)
2
Upvotes
View all comments
Show parent comment
1
u/CyclopsRock Mar 31 '21
Hmm, there probably won't be a basic example I'm afraid. Just shooting off some code or a function when a callback is triggered is easy enough :
To remove it, run:
The tricky bit is then getting a random function to interact with your UI, but it's not really too tricky:
Note: I remove the script callback on Open because if your script crashes whilst running it will never execute the 'on rollout close do' function and so you'll have this (probably broken) callback still firing off. This way it acts as a little bit of housekeeping.