// =========================================================================== // 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. // =========================================================================== global proc PolygonsSelectMenu(string $parent) // // Description: // Polygon Select menu // { if (! `isTrue "PolygonsExists"`) return; setParent -m $parent; if (`menu -q -ni $parent` != 0) { // Update menu items menuItem -e -enable `pluginInfo -q -loaded "modelingToolkit"` polySelectMultiComponentItem; } else { // Create menu items string $cmd = "SelectToggleMode"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectObjectComponent")) -ecr true -i "polyObjectComponent.png" -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd; $cmd = "SelectVertexMask"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectVertices")) -ecr true -i "polySelectVertex.png" -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd; $cmd = "SelectEdgeMask"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectEdge")) -ecr true -i "polySelectEdge.png" -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd; $cmd = "SelectFacetMask"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectFace")) -ecr true -i "polySelectFace.png" -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd; $cmd = "SelectMultiComponentMask"; menuItem -version "2014" -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectMultiComponent")) -ecr true -enable `pluginInfo -q -loaded "modelingToolkit"` -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd polySelectMultiComponentItem; $cmd = "SelectUVMask"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectUVs")) -ecr true -i "polySelectUV.png" -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd; $cmd = "SelectVertexFaceMask"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolySelectVtxFaces")) -ecr true -i "polySelectVertexFace.png" -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd; menuItem -divider true; // Edge Selection tools. // $cmd = "SelectBorderEdgeTool"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewSelectBorderEdgeTool")) -image "polySelectEdgeBorder.png" -annotation (getRunTimeCommandAnnotation($cmd)) -command ($cmd) polygonSelectBorderEdgeItem; $cmd = "SelectShortestEdgePathTool"; menuItem -label (uiRes("m_PolygonsSelectMenu.kSelectShortestEdgePathTool")) -image "selectEdgePath.png" -annotation (getRunTimeCommandAnnotation($cmd)) -command ($cmd) polySelectShortestPathItem; menuItem -divider true; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewPolyConvertSelection")) -sm 1 -to 1; $cmd = "ConvertSelectionToVertices"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToVertices")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToVertices.png" -command $cmd ; $cmd = "ConvertSelectionToVertexFaces"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToVertexFaces")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToVertexFaces.png" -command $cmd ; $cmd = "ConvertSelectionToVertexPerimeter"; menuItem -version "2015" -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToVertexPerimeter")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToShellBorder.png" -command $cmd ; menuItem -divider true; $cmd = "ConvertSelectionToUVs"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToUVs")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToUVs.png" -command $cmd ; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToUVShell")) -annotation (getRunTimeCommandAnnotation("ConvertSelectionToUVShell")) -image "polyConvertToUVShell.png" -command "ConvertSelectionToUVShell" ; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToUVBorder")) -annotation (getRunTimeCommandAnnotation("ConvertSelectionToUVShellBorder")) -image "polyConvertToUVBorder.png" -command "ConvertSelectionToUVShellBorder" ; $cmd = "ConvertSelectionToUVPerimeter"; menuItem -version "2015" -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToUVPerimeter")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToShellBorder.png" -command $cmd ; $cmd = "ConvertSelectionToUVEdgeLoop"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToUVEdgeLoop")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToUVEdgeLoop.png" -command $cmd ; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToShell")) -annotation (getRunTimeCommandAnnotation("ConvertSelectionToShell")) -image "polyConvertToShell.png" -command "polyConvertToShell" ; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToShellBorder")) -annotation (getRunTimeCommandAnnotation("ConvertSelectionToShellBorder")) -image "polyConvertToShellBorder.png" -command "polyConvertToShellBorder" ; menuItem -divider true; $cmd = "ConvertSelectionToEdges"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToEdges")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToEdge.png" -command $cmd ; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToEdgeLoop")) -command "SelectEdgeLoopSp" -image "polyConvertToEdgeLoop.png" -annotation (getRunTimeCommandAnnotation ("SelectEdgeLoop")) ; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToEdgeRing")) -command "SelectEdgeRingSp" -image "polyConvertToEdgeRing.png" -annotation (getRunTimeCommandAnnotation ("SelectEdgeRing")) ; $cmd = "ConvertSelectionToContainedEdges"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToContainedEdges")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToContainedEdges.png" -command $cmd ; $cmd = "ConvertSelectionToEdgePerimeter"; menuItem -version "2015" -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToEdgePerimeter")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToShellBorder.png" -command $cmd ; menuItem -divider true; $cmd = "ConvertSelectionToFaces"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToFaces")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToFace.png" -command $cmd ; $cmd = "SelectFacePath"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToFacePath")) -command $cmd -image "polyConvertToFacePath.png" -annotation (getRunTimeCommandAnnotation ($cmd)) ; $cmd = "ConvertSelectionToContainedFaces"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewConvertSelectionToContainedFaces")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyConvertToContainedFaces.png" -command $cmd ; setParent -m ..; menuItem -divider true; $cmd = "GrowPolygonSelectionRegion"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewGrowSelectionRegion")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyGrowSelection.png" -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 1\"" ; $cmd = "GrowLoopPolygonSelectionRegion"; menuItem -version "2018" -label (uiRes("m_PolygonsSelectMenu.kNewGrowLoopSelectionRegion")) -annotation (getRunTimeCommandAnnotation($cmd)) -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 1\"" ; $cmd = "ShrinkPolygonSelectionRegion"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewShrinkSelectionRegion")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyShrinkSelection.png" -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 2\"" ; $cmd = "ShrinkLoopPolygonSelectionRegion"; menuItem -version "2018" -label (uiRes("m_PolygonsSelectMenu.kNewShrinkLoopSelectionRegion")) -annotation (getRunTimeCommandAnnotation($cmd)) -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 2\"" ; $cmd = "SelectPolygonSelectionBoundary"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewSelectSelectionBoundary")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polySelectBoundary.png" -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 3\"" ; $cmd = "SelectContiguousEdges"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewSelectContiguousEdges")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyLoopEdge.png" -command $cmd ; $cmd = "SelectContiguousEdgesOptions"; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation($cmd)) -image "polyLoopEdge.png" -command $cmd ; menuItem -divider true; $cmd = "PolygonSelectionConstraints"; menuItem -label (uiRes("m_PolygonsSelectMenu.kNewSelectionConstraints")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "polySelectUsingConstraints.png" -command $cmd ; setParent -m ..; } }