MEL How-To #48 | ||
| ||
How do I toggle the visibility of the Model panels' menu bars?The command that Maya uses to toggle the panel menuBars is: toggleMenuBarsInPanels This is found in the MEL script: <MAYA_INSTALL_DIR>\scripts\startup\createPrefWndUI.mel
Frankly, this function doesn't make sense. It's self-described as a toggle, yet requires a 'true'/'false' argument to actually set the state. Weird. To implement your own toggle: global proc actuallyToggleMenuBarsInPanels() { global int $gUseMenusInPanels; toggleMenuBarsInPanels( !$gUseMenusInPanels ); } Call your ‘ If you want to toggle the menuBar for only the active panel: global proc toggleMenuBarInPanelWithFocus() { string $panel = `getPanel -withFocus`; panel -e -mbv ( !`panel -q -mbv $panel` ) $panel; } This is performed in-place and will not affect the user's preference. Related How-To's
Monday, May 21, 2001 | ||
Copyright ©2005 by Bryan Ewert, maya@ewertb.com Maya is a Registered Trademark of Alias |