// =========================================================================== // 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: // buildSelectMenu // // Description: // Builds all the items in the Select menu when // the user clicks on the menu. Checks to see if // there are any children in the menu already, and // if so, doesn't rebuild the menu. // // Input Arguments: // Name of the parent menu. // // Return Value: // None. // global proc buildSelectMenu( string $parent ) { string $menu; setParent -menu $parent; if( `menu -q -ni $parent` != 0 ) { // // Menu is already built - just return // return; } string $cmd = "SelectAll"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) -version "2014" selectAllItem; // Select all by type sub-menu. // global string $gEditSelectAllByTypeSubMenu; $gEditSelectAllByTypeSubMenu = `menuItem -label (uiRes("m_buildSelectMenu.kSelectAllByType")) -subMenu true -to true selAllHierItem`; $cmd = "SelectAllIKHandles"; menuItem -ltVersion "2015" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selIKHanItem; $cmd = "SelectAllJoints"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selJointsItem; menuItem -divider true; $cmd = "SelectAllClusters"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -ltVersion 2016 -command ($cmd); $cmd = "SelectAllLattices"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); $cmd = "SelectAllSculptObjects"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); $cmd = "SelectAllWires"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); menuItem -divider true; $cmd = "SelectAllTransforms"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selDAGItem; $cmd = "SelectAllGeometry"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selGeomItem; $cmd = "SelectAllNURBSCurves"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selNurbsCurveItem; $cmd = "SelectAllNURBSSurfaces"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selNurbsSurfaceItem; $cmd = "SelectAllPolygonGeometry"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selPolysItem; menuItem -divider true; $cmd = "SelectAllCameras"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selCamerasItem; $cmd = "SelectAllLights"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selLightsItem; $cmd = "SelectAllImagePlanes"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); menuItem -divider true; $cmd = "SelectAllAssets"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selContainersItem; menuItem -divider true; $cmd = "SelectAllFluids"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selFluidsItem; $cmd = "SelectAllParticles"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selParticlesItem; $cmd = "SelectAllRigidBodies"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selRigidBodiesItem; $cmd = "SelectAllRigidConstraints"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selRigidConstraintsItem; if(`isTrue "MayaCreatorExists"` && (`licenseCheck -m "edit" -typ "particlePaint"`)) { menuItem -divider true; $cmd = "SelectAllBrushes"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selAllBrushesItem; $cmd = "SelectAllStrokes"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selAllStrokesItem; } menuItem -divider true; $cmd = "SelectAllDynamicConstraints"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selDynamicConstraintsItem; $cmd = "SelectAllFollicles"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selFolliclesItem; $cmd = "SelectAllNCloths"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selNClothsItem; $cmd = "SelectAllNParticles"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selNParticlesItem; $cmd = "SelectAllNRigids"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) selNRigidsItem; setParent -menu ..; // END SELECT BY TYPE SUB MENU $cmd = "SelectNone"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) deselectItem; $cmd = "SelectHierarchy"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); $cmd = "InvertSelection"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) invertSelectionItem; $cmd = "SelectSimilar"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -version "2014" -command ($cmd) selectSimilarItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("SelectSimilarOptions")) -command ("SelectSimilarOptions") selectSimilarOptItem; menuItem -divider true -longDivider false; $cmd = "GrowPolygonSelectionRegion"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 1\"" ; $cmd = "GrowLoopPolygonSelectionRegion"; menuItem -version "2018" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 1\"" ; $cmd = "ShrinkPolygonSelectionRegion"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 2\"" ; $cmd = "ShrinkLoopPolygonSelectionRegion"; menuItem -version "2018" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command $cmd -dragMenuCommand "polygonsMenuItemToShelf \"polySelectConstraint -pp 2\"" ; menuItem -divider true -longDivider false; // Quick Select Sets sub-menu. // $menu = `menuItem -ltVersion 2016 -label (uiRes("m_buildSelectMenu.kSelectQuickSelectSets")) -sm true selectCharItem`; menuItem -e -pmc ( "createCharacterMenu " + $menu ) $menu; setParent -menu ..; menuItem -divider true -dividerLabel (uiRes("m_buildSelectMenu.kSelectType")); $cmd = "SelectToggleMode"; menuItem -ecr true -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd; menuItem -divider true -dividerLabel (uiRes("m_buildSelectMenu.kSelectPolygons")); menuItem -label (uiRes("m_buildSelectMenu.kSelectPolyComponents")) -sm true -tearOff true; $cmd = "SelectMultiComponentMask"; menuItem -version "2014" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -ecr true -enable `pluginInfo -q -loaded "modelingToolkit"` -command $cmd polySelectMultiComponentItem; menuItem -divider true; $cmd = "SelectVertexMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -ecr true -command $cmd; $cmd = "SelectEdgeMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -ecr true -command $cmd; $cmd = "SelectFacetMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -ecr true -command $cmd; $cmd = "SelectVertexFaceMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -ecr true -command $cmd; $cmd = "SelectUVMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -ecr true -command $cmd; $cmd = "SelectMeshUVShell"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) ; setParent -m ..; menuItem -divider true -longDivider false; $cmd = "SelectContiguousEdges"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("SelectContiguousEdgesOptions")) -image "polyLoopEdge.png" -command "SelectContiguousEdgesOptions" ; $cmd = "SelectShortestEdgePathTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) polySelectShortestPathItem ; menuItem -divider true -longDivider false; menuItem -label (uiRes("m_buildSelectMenu.kSelectPolyConvertSelection")) -sm 1 -to 1; $cmd = "ConvertSelectionToVertices"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToVertexFaces"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToVertexPerimeter"; menuItem -version "2015" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; menuItem -divider true; $cmd = "ConvertSelectionToEdges"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "SelectEdgeLoopSp"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) ; $cmd = "SelectEdgeRingSp"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) ; $cmd = "ConvertSelectionToContainedEdges"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToEdgePerimeter"; menuItem -version "2015" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; menuItem -divider true; $cmd = "ConvertSelectionToFaces"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "SelectFacePath"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToContainedFaces"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToFacePerimeter"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; menuItem -divider true; $cmd = "ConvertSelectionToUVs"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToUVShell"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) ; $cmd = "ConvertSelectionToUVShellBorder"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) ; $cmd = "ConvertSelectionToUVPerimeter"; menuItem -version "2015" -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; $cmd = "ConvertSelectionToUVEdgeLoop"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; menuItem -divider true; $cmd = "ConvertSelectionToShell"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) ; $cmd = "ConvertSelectionToShellBorder"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) ; setParent -m ..; $cmd = "PolygonSelectionConstraints"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command $cmd ; menuItem -divider true -dividerLabel (uiRes("m_buildSelectMenu.kSelectNurbsCurves")); // NURBS Curves Component submenu // menuItem -label (uiRes("m_buildSelectMenu.kSelCrvComponent")) -sm true -to true; $cmd = "SelectCVsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; $cmd = "SelectCurvePointsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; $cmd = "SelectPointsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; $cmd = "SelectHullsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; setParent -m ..; menuItem -divider true -longDivider false; $cmd = "SelectCurveCVsAll"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) allCurveCVsItem; $cmd = "SelectCurveCVsFirst"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) firstCurveCVsItem; $cmd = "SelectCurveCVsLast"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) lastCurveCVsItem; menuItem -divider true; $cmd = "ClusterCurve"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) clusterCurveItem; menuItem -divider true -dividerLabel (uiRes("m_buildSelectMenu.kSelectNurbsSurfaces")); // NURBS Surfaces Component submenu // menuItem -label (uiRes("m_buildSelectMenu.kSelSurfaceComponent")) -sm true -to true; $cmd = "SelectCVsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; $cmd = "SelectHullsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; $cmd = "SelectLinesMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; $cmd = "SelectSurfacePointsMask"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -version "2016" -command ($cmd) ; setParent -m ..; menuItem -divider true -longDivider false; $cmd = "SelectCVSelectionBoundary"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "SelectSurfaceBorder"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); menuItem -optionBox true -ecr false -annotation `runTimeCommand -q -ann ("SelectSurfaceBorderOptions")` -image "selectSurfaceBorder.png" -command "SelectSurfaceBorderOptions" ; }