PDA

View Full Version : Window remember inputs


ah-fx
07-14-2009, 05:20 PM
Option windows for built in tools will remember inputs like check box and radio selections, can I do the same thing with a mel custom window?

s0ke
07-14-2009, 07:19 PM
After a complete shutdown of the application or just the custom window?

I think whatever the last call you make to your checkbox/radio selection - enable(1) or disable(0) - will be saved even if you close down your custom window. So if you enable your checkbox, and then close your custom window down. The next time you open your window the checkbox will remain checked. Although I'm not sure if this is true if Maya is closed completely and then re-opened.

goleafsgo
07-14-2009, 07:34 PM
Tools, like Move/Rotate/Scale, have their current settings saved before Maya shuts down. So the UI code for the Tools Settings Window in particular doesn't exactly need to do anything special to remember it...it just asks the tool for its current settings and sets the UI occordingly.

For something like the state of the UI in an option box you would store everything in optionVar's. So when the UI is initialized you would read in the values of your optionVars and set the UI elements from that, and then when you close the window you would set the optionVar's based on the UI elements.

Not sure if that makes sense or not...

meuH
07-14-2009, 07:37 PM
look into the optionVar command

http://download.autodesk.com/us/maya/2009help/Commands/optionVar.html

edit: got beaten to it :)

CGTalk Moderation
07-14-2009, 07:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.