ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
If the scripts are not encrypted then you can see the global "name" of the rollouts. What you have to do then is to use for loop to destroy dialogs with the desired names.
For example:
global rol_01
rollout rol_01 "The name of the rollout"()
createdialog rol_01
global rol_02
rollout rol_02 "The name of the rollout 01"()
createdialog rol_02
global rol_03
rollout rol_03 "The name of the rollout 03"()
createdialog rol_03
To close the "The name of the rollout rollout you have to use
OK.. now how do you destroy the dialogs upon exiting the script .. the on quit do (whatever) doesn't seem to work when you just close the rollout.. I have a main script and a few ones pop out, I can destroy them in the beginning of the script but not when I just close the rollout window.. any solutions on that?
(
global rol_MyRollout
try(destroyDialog rol_MyRollout)catch()
rollout rol_MyRollout "My Rollout"(-- when the main rollout is closed
on rol_MyRollout close do(-- destroy other dialog shere))
createdialog rol_MyRollout
)
hmm.. yes exactly..
..actually did that but placed it after the createdialog :) - forgot this should probably be the part of the rollout, thanks
.. is the global rollout necessary I do it without that, or why?
(try(destroyDialog rol_MyRollout)catch()
rollout rol_MyRollout "My Rollout"(-- when the main rollout is closed
on rol_MyRollout close do(-- destroy other dialog shere))
createdialog rol_MyRollout
)
Then all variables are in local scope, so you can't access them.
If your code is:
try(destroyDialog rol_MyRollout)catch()
rollout rol_MyRollout "My Rollout"(-- when the main rollout is closed
on rol_MyRollout close do(-- destroy other dialog shere))
createdialog rol_MyRollout
Then the rollout var(rol_MyRollout) is a global var and you can access it and all controls and local variables of the rollout.
Since I always use the first aproach(all of my code is between "(" and ")") i have to declare the tollout as global.
yes - and I need the global rollout variable defined like you just did - or it wont close the rollout - also just realized this :).. what's with the ::dialog (didn't get to that part yet)
OK learning as I go.. I did programming in java years ago, and it's like learning how to walk again, this place is a great resource
Comments
.
If the scripts are not encrypted then you can see the global "name" of the rollouts. What you have to do then is to use for loop to destroy dialogs with the desired names.
For example:
To close the "The name of the rollout rollout you have to use
Tools and Scripts for Autodesk 3dsMax
OK.. now how do you destroy the dialog on exit
OK.. now how do you destroy the dialogs upon exiting the script .. the on quit do (whatever) doesn't seem to work when you just close the rollout.. I have a main script and a few ones pop out, I can destroy them in the beginning of the script but not when I just close the rollout window.. any solutions on that?
https://kresimirjelusic.artstation.com/
https://www.facebook.com/HumanLaboratory
https://gumroad.com/robob3ar
.
If I understand you correctly yo need this:
Tools and Scripts for Autodesk 3dsMax
hmm.. yes
hmm.. yes exactly..
..actually did that but placed it after the createdialog :) - forgot this should probably be the part of the rollout, thanks
.. is the global rollout necessary I do it without that, or why?
https://kresimirjelusic.artstation.com/
https://www.facebook.com/HumanLaboratory
https://gumroad.com/robob3ar
.
If your code ls this:
Then all variables are in local scope, so you can't access them.
If your code is:
Then the rollout var(rol_MyRollout) is a global var and you can access it and all controls and local variables of the rollout.
Since I always use the first aproach(all of my code is between "(" and ")") i have to declare the tollout as global.
Tools and Scripts for Autodesk 3dsMax
and just realised you should
and just realised you should also use
try (destroyDialog dialog ) catch()
because if that rollout isn't open it gives out error.. or it doesn't close the main rollout, just for future reference
https://kresimirjelusic.artstation.com/
https://www.facebook.com/HumanLaboratory
https://gumroad.com/robob3ar
...
better is to declare rollout var as global
bga
yes - and I need the global
yes - and I need the global rollout variable defined like you just did - or it wont close the rollout - also just realized this :).. what's with the ::dialog (didn't get to that part yet)
OK learning as I go.. I did programming in java years ago, and it's like learning how to walk again, this place is a great resource
https://kresimirjelusic.artstation.com/
https://www.facebook.com/HumanLaboratory
https://gumroad.com/robob3ar
...
If you want to avoid try-catch then you can use also
bga