MEL UI - Remember state of Collapsible frameLayout TAB

MEL UI - Remember state of Collapsible frameLayout TAB

The-Digital-Shaman
Advocate Advocate
337 Views
1 Reply
Message 1 of 2

MEL UI - Remember state of Collapsible frameLayout TAB

The-Digital-Shaman
Advocate
Advocate

Hi there,

 

Could someone point me at how to make Maya remember state of collapsible frameLayout tabs after closing?

 

Since it's not mentioned in synopsis;  https://download.autodesk.com/us/maya/2009help/CommandsPython/frameLayout.html

I guess it takes more than just a flag?

 

 

Kind regards,

DS

0 Likes
338 Views
1 Reply
Reply (1)
Message 2 of 2

Kahylan
Advisor
Advisor

Hi!

 

Yeah, its not that simple sadly, the "collapse" flag is responsible for the collapse state of the UI, if you want it to keep the same state after reopening, you'll need to feed it the value from another source.

 

Now it depends on what behaviour you want. If you want the UI to open in the same state in all Scenes on the same machine, you normally store the state of the collapse flags of your UI in an optionVar in the preferences.

 

If you want your UI to have Scene specific collapse states and open the same in the scene you are working in, but in a different state you saved in another scene you are working in, you would normally store the collapse settings on a hidden node (most commonly a network node) as an attibute and then gather it again from there.

 

You could also store the collapse state in a global variable, that way the UI will open up the same during the current session, but revert to default once maya is closed an opened again. But global variables can become quite problematic, and while they are fine for something simple like this, I wouldn't make a habit out of using them.

 

If you want some more information on one of these methods, let me know.

 

I hope it helps!

 

0 Likes