// =========================================================================== // 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. // =========================================================================== // // Script: polySelConstraintPanel.mel // // SYNOPSIS // Creates the mel components around the polySelConstraintEditor // global proc polySelectionConstraintPanel(string $panelName) { global string $gMainPane; if (!`scriptedPanelType -exists polySelectionConstraintPanel`) { scriptedPanelType -unique true -addCallback "addPolySelConstraintWindow" -removeCallback "removePolySelConstraintWindow" -label (uiRes("m_polySelConstraintPanel.kPolySelectionConstraintPanel")) polySelectionConstraintPanel; setParent $gMainPane; scriptedPanel -unParent -type "polySelectionConstraintPanel" $panelName; } } global proc buildPolyConstraintContextHelpItems(string $nameRoot, string $menuParent) // // Description: // Build context sensitive menu items // // Input Arguments: // $nameRoot - name to use as the root of all item names // $menuParent - the name of the parent of this menu // // Return Value: // None // { menuItem -label (uiRes("m_polySelConstraintPanel.kPolySelectionConstraintPanelHelp")) -enableCommandRepeat false -command "showHelp SelectionConstraints"; } global proc addPolySelConstraintWindow(string $whichPanel) { int $menusOkayInPanels = `optionVar -q allowMenusInPanels`; panel -e -mbv $menusOkayInPanels $whichPanel; // Build Menubar. menu -label (uiRes("m_polySelConstraintPanel.kPolySelectionConstraintPanelReset")) ($whichPanel+"resetMenu"); menuItem -label (uiRes("m_polySelConstraintPanel.kPolySelectionConstraintPanelDisableAll")) -c ("resetPolySelectConstraint; polygonConstraintUpdate(\"" + $whichPanel + "\");") ($whichPanel+"resetMenuDisable"); // Add support for the Context Sensitive Help Menu. // addContextHelpProc $whichPanel "buildPolyConstraintContextHelpItems"; // create Monitor polySelectConstraintMonitor -create; // fill panel polygonConstraint($whichPanel); } global proc removePolySelConstraintWindow(string $whichPanel) { // delete Monitor polySelectConstraintMonitor -delete; }