// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Procedure Name: // buildPreferenceMenu // // Description: // Create the UI Elements menu // // Input Arguments: // parent to parent the menu to. // // Return Value: // None. // global proc buildPreferenceMenu ( string $parent ) { // Clear out all menu items, and rebuild // the menu to keep the menu in sync across // the different Maya UI // if( `menu -q -ni $parent` != 0 ) { // // Menu is built already - just return // updatePrefsMenu; return; } setParent -m $parent; // // Create menu items // menuItem -checkBox true -rtc "ToggleStatusLine" statusLineItem; menuItem -checkBox true -rtc "ToggleShelf" shelfItem; menuItem -checkBox true -rtc "ToggleTimeSlider" timelineItem; menuItem -enable true -checkBox true -rtc "ToggleRangeSlider" playbackRangeItem; menuItem -checkBox true -rtc "ToggleCommandLine" commandLineItem; menuItem -checkBox true -rtc "ToggleHelpLine" helpLineItem; menuItem -divider true; menuItem -checkBox true -rtc "ToggleToolbox" toolboxItem; menuItem -divider true; menuItem -rtc "HideUIElements"; menuItem -rtc "ShowUIElements"; menuItem -rtc "RestoreUIElements"; setParent -menu ..; // Run the proc that keeps the checkboxes in sync // with what decorations on Maya's windows are shown // or not shown // updatePrefsMenu; }