View Full Version : toggaling panel window

11 November 2010, 09:24 PM
I'm having problems with this script its kind of working but not really. I'm trying to create a button where I can toggle on and off certain parts of Maya's visible windows. I got this far but i don't know why certain parts work fine and others don't. When i run the code the main menu, and file menu turn off when they should be on and on when they should be off. When all the tools are visible they should be on to but when just the shelf is visible then they should be off as well. Here is the code can some one tell me why this is not working?

toggleUIComponentVisibility "Status Line";
toggleUIComponentVisibility "Tool Box";
toggleUIComponentVisibility "Time Slider";
toggleUIComponentVisibility "Range Slider";
toggleUIComponentVisibility "Help Line";

int $ToggleTag = (($ToggleTag + 1) % 2);

if (`menu -q -ni MayaWindow|HotBoxControlsMenu` == 0)
toggleMainMenubar 0;
toggleMenuBarsInAllPanels 0;
toggleMainMenubar 1;
toggleMenuBarsInAllPanels 1;

11 November 2010, 01:22 PM
He Shaby!

in the mel script: C:/Program Files (x86)/Autodesk/Maya2009/scripts/startup/UIComponents.mel

there is more than toggleUIComponentVisibility. For instance: setUIComponentVisibility(string $name, int $visible) and isUIComponentVisible(string $name). Have a look. I've used them as well in a toggling script.

CGTalk Moderation
11 November 2010, 01:22 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.