// =========================================================================== // 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. // =========================================================================== // // Creation Date: 28 June 1996 // // // Procedure Name: // ModelEdMenu // // Description: // This procedure creates the popup/marking menu // that gets attached to the main view panes. // This menu builds dynamically, and changes its // contents based what item the mouse is clicked over. // // Input Arguments: // The parent item to parent the popup menu to. // // Return Value: // None. // global proc ModelEdMenu( string $panelName ) { global int $gIsMarkingMenuOn; // Find out current location of the panel and ensure that it has // a control layout associated with it. // string $panelControl = `modelEditor -q -control $panelName`; if( $panelControl != "" ) { // regular popup mappings. int $objectButton = 3; int $ctlObjectQualifier = 0; int $shObjectQualifier = 0; string $objectMenuName = ( $panelName + "ObjectPop" ); string $convertMenuName = ( $panelName + "ConvertPop" ); string $commandMenuName = ( $panelName + "CommandPop" ); string $toolOptionsMenuName = ( $panelName + "ToolOptionsPop" ); // Build the object specific menu if( !`popupMenu -exists $objectMenuName` ) { string $fullObjectMenuName = `popupMenu -parent $panelControl $objectMenuName`; string $buildObjectMenuItemsNow = "buildObjectMenuItemsNow"; popupMenu -e -mm $gIsMarkingMenuOn -button $objectButton -sh $shObjectQualifier -ctl $ctlObjectQualifier -aob true -pmc ( $buildObjectMenuItemsNow + " \"" + $fullObjectMenuName + "\"") $objectMenuName; } if (!`popupMenu -exists $convertMenuName`) { string $fullConvertMenuName = `popupMenu -parent $panelControl -allowOptionBoxes true $convertMenuName`; string $buildConvertMM = "buildConvertMM"; popupMenu -edit -markingMenu $gIsMarkingMenuOn -ctrlModifier true -button 3 -postMenuCommand ($buildConvertMM + " \"" + $fullConvertMenuName + "\"") $convertMenuName; } if (!`popupMenu -exists $commandMenuName`) { string $fullCommandMenuName = `popupMenu -parent $panelControl -allowOptionBoxes true $commandMenuName`; string $buildCommandMM = "contextToolsMM"; popupMenu -edit -markingMenu $gIsMarkingMenuOn -ctrlModifier false -shiftModifier true -button 3 -postMenuCommand ($buildCommandMM + " \"" + $fullCommandMenuName + "\"") $commandMenuName; } if (!`popupMenu -exists $toolOptionsMenuName`) { string $fullToolOptionsMenuName = `popupMenu -parent $panelControl -allowOptionBoxes true $toolOptionsMenuName`; string $buildCommandMM = "buildToolOptionsMM"; popupMenu -edit -markingMenu $gIsMarkingMenuOn -ctrlModifier true -shiftModifier true -button 3 -postMenuCommand ($buildCommandMM + " \"" + $fullToolOptionsMenuName + "\"") $toolOptionsMenuName; } } }