// =========================================================================== // 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: // ModCreateMenu // // Description: // Create the 'Create' menu // // Input Arguments: // parent to parent the menu to. // // Return Value: // None. // proc ModNurbsPrimitiveMenuItem( string $parent ) // // Proc : To create NURBS primitives. // { string $cmd; setParent -menu $parent; if (`isTrue "NurbsExists"`) { menuItem -divider true -dividerLabel (uiRes("m_ModCreateMenu.kCreateObjects")); menuItem -label (uiRes("m_ModCreateMenu.kCreateNurbsPrimitives")) -subMenu true -tearOff true -allowOptionBoxes true; if (`isTrue "SurfaceUIExists"`) { $cmd = "CreateNURBSSphere"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsSphere(2)") -dragDoubleClickCommand ("CreateNURBSSphereOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSSphereOptions")) -image "sphere.png" -command ("CreateNURBSSphereOptions"); $cmd = "CreateNURBSCube"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsCube(2)") -dragDoubleClickCommand ("CreateNURBSCubeOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSCubeOptions")) -image "cube.png" -command ("CreateNURBSCubeOptions"); $cmd = "CreateNURBSCylinder"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsCylinder(2)") -dragDoubleClickCommand ("CreateNURBSCylinderOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSCylinderOptions")) -image "cylinder.png" -command ("CreateNURBSCylinderOptions"); $cmd = "CreateNURBSCone"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsCone(2)") -dragDoubleClickCommand ("CreateNURBSConeOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSConeOptions")) -image "cone.png" -command ("CreateNURBSConeOptions"); $cmd = "CreateNURBSPlane"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsPlane(2)") -dragDoubleClickCommand ("CreateNURBSPlaneOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSPlaneOptions")) -image "plane.png" -command ("CreateNURBSPlaneOptions"); $cmd = "CreateNURBSTorus"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsTorus(2)") -dragDoubleClickCommand ("CreateNURBSTorusOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSTorusOptions")) -image "torus.png" -command ("CreateNURBSTorusOptions"); } $cmd = "CreateNURBSCircle"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsCircle(2)") -dragDoubleClickCommand ("CreateNURBSCircleOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSCircleOptions")) -image "circle.png" -command ("CreateNURBSCircleOptions"); $cmd = "CreateNURBSSquare"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performNurbsSquare(2)") -dragDoubleClickCommand ("CreateNURBSSquareOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateNURBSSquareOptions")) -image "square.png" -command ("CreateNURBSSquareOptions"); menuItem -divider true; menuItem -rtc "ToggleCreateNurbsPrimitivesAsTool" -checkBox `optionVar -q createNurbsPrimitiveAsTool` toggleCreateNurbsPrimitivesAsToolItem; menuItem -rtc "ToggleNurbsPrimitivesAsToolExitOnComplete" -checkBox `optionVar -q nurbsPrimitiveAsToolExitOnComplete` toggleNurbsPrimitivesAsToolItemExitOnComplete; setParent -menu .. ; } setParent -menu .. ; } proc ModPolyPrimitiveMenuItem( string $parent ) // // Description : // To create Poly primitives menu. // { string $cmd; setParent -menu $parent; if( `isTrue "PolygonsExists"` ) { menuItem -label (uiRes("m_ModCreateMenu.kCreatePolyPrimitives")) -subMenu true -tearOff true -allowOptionBoxes true polyPrimitivesItem; $cmd = "CreatePolygonSphere"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Sphere 2") -dragDoubleClickCommand ("CreatePolygonSphereOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonSphereOptions")) -image "polySphere.png" -command ("CreatePolygonSphereOptions"); $cmd = "CreatePolygonCube"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Cube 2") -dragDoubleClickCommand ("CreatePolygonCubeOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonCubeOptions")) -image "polyCube.png" -command ("CreatePolygonCubeOptions"); $cmd = "CreatePolygonCylinder"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Cylinder 2") -dragDoubleClickCommand ("CreatePolygonCylinderOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonCylinderOptions")) -image "polyCylinder.png" -command ("CreatePolygonCylinderOptions"); $cmd = "CreatePolygonCone"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Cone 2") -dragDoubleClickCommand ("CreatePolygonConeOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonConeOptions")) -image "polyCone.png" -command ("CreatePolygonConeOptions"); $cmd = "CreatePolygonTorus"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Torus 2") -dragDoubleClickCommand ("CreatePolygonTorusOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonTorusOptions")) -image "polyTorus.png" -command ("CreatePolygonTorusOptions"); $cmd = "CreatePolygonPlane"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Plane 2") -dragDoubleClickCommand ("CreatePolygonPlaneOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonPlaneOptions")) -image "polyMesh.png" -command ("CreatePolygonPlaneOptions"); $cmd = "CreatePolygonDisc"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -version 2018 -allowOptionBoxes true polyDiscItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonDiscOptions")) -image "polyDisc.png" -command ("CreatePolygonDiscOptions"); menuItem -divider true; $cmd = "CreatePolygonPlatonic"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -version 2018 -allowOptionBoxes true polyPlatonicItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonPlatonicOptions")) -image "polyPlatonicSolid.png" -command ("CreatePolygonPlatonicOptions"); $cmd = "CreatePolygonPyramid"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Pyramid 2") -dragDoubleClickCommand ("CreatePolygonPyramidOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonPyramidOptions")) -image "polyPyramid.png" -command ("CreatePolygonPyramidOptions"); $cmd = "CreatePolygonPrism"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Prism 2") -dragDoubleClickCommand ("CreatePolygonPrismOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonPrismOptions")) -image "polyPrism.png" -command ("CreatePolygonPrismOptions"); $cmd = "CreatePolygonPipe"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Pipe 2") -dragDoubleClickCommand ("CreatePolygonPipeOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonPipeOptions")) -image "polyPipe.png" -command ("CreatePolygonPipeOptions"); $cmd = "CreatePolygonHelix"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Helix 2") -dragDoubleClickCommand ("CreatePolygonHelixOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonHelixOptions")) -image "polyHelix.png" -command ("CreatePolygonHelixOptions"); $cmd = "CreatePolygonGear"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -version 2018 -allowOptionBoxes true polyGearItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonGearOptions")) -image "polyGear.png" -command ("CreatePolygonGearOptions"); $cmd = "CreatePolygonSoccerBall"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPolyPrimitive Misc 0") -dragDoubleClickCommand ("CreatePolygonSoccerBallOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonSoccerBallOptions")) -image "polySoccerBall.png" -command ("CreatePolygonSoccerBallOptions"); menuItem -label (uiRes("m_ModCreateMenu.kCreatePolySuperShapes")) -divider true; $cmd = "CreatePolygonSuperEllipse"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -version 2018 -allowOptionBoxes true polySuperEllipseItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonSuperEllipseOptions")) -image "polySuperEllipse.png" -command ("CreatePolygonSuperEllipseOptions"); $cmd = "CreatePolygonSphericalHarmonics"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -version 2018 -allowOptionBoxes true polySphericalHarmonicsItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonSphericalHarmonicsOptions")) -image "polySphericalHarmonics.png" -command ("CreatePolygonSphericalHarmonicsOptions"); $cmd = "CreatePolygonUltraShape"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -version 2018 -allowOptionBoxes true polyUltraShapeItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePolygonUltraShapeOptions")) -image "polyUltraShape.png" -command ("CreatePolygonUltraShapeOptions"); menuItem -divider true; menuItem -rtc "ToggleCreatePolyPrimitivesAsTool" -checkBox `optionVar -q createPolyPrimitiveAsTool` toggleCreatePolyPrimitivesAsToolItem; menuItem -rtc "TogglePolyPrimitivesAsToolExitOnComplete" -checkBox `optionVar -q polyPrimitiveAsToolExitOnComplete` togglePolyPrimitivesAsToolItemExitOnComplete; setParent -menu ..; setParent -menu ..; } setParent -menu .. ; } proc ModSubdPrimitiveMenuItem( string $parent ) // // Description : // To create Subd primitives menu. // Added by CM { string $cmd; setParent -menu $parent; if( `isTrue "SubdivUIExists"` ) { menuItem -label (uiRes("m_ModCreateMenu.kCreateSubivPrimitives")) -subMenu true -tearOff true -allowOptionBoxes true subdPrimitivesItem; $cmd = "CreateSubdivSphere"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateSubdivCube"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateSubdivCylinder"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateSubdivCone"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateSubdivPlane"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateSubdivTorus"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); setParent -menu ..; } setParent -menu .. ; } proc ModVolumePrimitiveMenuItem( string $parent ) // // Description : // To create Volume primitives menu. // { string $cmd; setParent -menu $parent; if( `isTrue "PolygonsExists"` ) { menuItem -label (uiRes("m_ModCreateMenu.kCreateVolumePrimitives")) -subMenu true -tearOff true -allowOptionBoxes true volumePrimitivesItem; $cmd = "CreateVolumeSphere"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateVolumeCube"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateVolumeCone"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); setParent -menu ..; } setParent -menu .. ; } global proc refreshLightsItem() { // allow third parties to install their own custom light creation UI in this menu callbacks -executeCallbacks -hook "addItemToCreateLightMenu"; } proc ModLightsMenuItem( string $parent ) // // Description : // To create Lights menu. // Note : Divider added at the end by proc. // { string $cmd; setParent -menu $parent; menuItem -label (uiRes("m_ModCreateMenu.kCreateLights")) -sm true -tearOff true -allowOptionBoxes true LightsItem; $cmd = "CreateAmbientLight"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performAmbientLight 2") -dragDoubleClickCommand ("CreateAmbientLightOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateAmbientLightOptions")) -image "ambientlight.png" -command ("CreateAmbientLightOptions"); $cmd = "CreateDirectionalLight"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performDirectionalLight 2") -dragDoubleClickCommand ("CreateDirectionalLightOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateDirectionalLightOptions")) -image "directionallight.png" -command ("CreateDirectionalLightOptions"); $cmd = "CreatePointLight"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performPointLight 2") -dragDoubleClickCommand ("CreatePointLightOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePointLightOptions")) -image "pointlight.png" -command ("CreatePointLightOptions"); $cmd = "CreateSpotLight"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performSpotLight 2") -dragDoubleClickCommand ("CreateSpotLightOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateSpotLightOptions")) -image "spotlight.png" -command ("CreateSpotLightOptions"); $cmd = "CreateAreaLight"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -ltVersion 2017 -dragMenuCommand ("performAreaLight(2)") -dragDoubleClickCommand ("CreateAreaLightOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateAreaLightOptions")) -image "arealight.png" -command ("CreateAreaLightOptions"); $cmd = "CreateVolumeLight"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performVolumeLight 2") -dragDoubleClickCommand ("CreateVolumeLightOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateVolumeLightOptions")) -image "volumelight.png" -command ("CreateVolumeLightOptions"); menuItem -e -postMenuCommand "refreshLightsItem" LightsItem; setParent -menu ..; setParent -menu .. ; } proc ModCurveToolsMenuItem( string $parent ) // // Description : // To create Curve Tools menu. Arc tools included. // { string $cmd; setParent -menu $parent ; if (`isTrue "NurbsExists"`) { menuItem -label (uiRes("m_ModCreateMenu.kCreateCurveTools")) -sm true -tearOff true createCurveTools; $cmd = "CVCurveTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("CVCurveToolOptions"); menuItem -optionBox true -image "curveCV.png" -annotation (getRunTimeCommandAnnotation("CVCurveToolOptions")) -command ("CVCurveToolOptions"); $cmd = "EPCurveTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("EPCurveToolOptions"); menuItem -optionBox true -image "curveEP.png" -annotation (getRunTimeCommandAnnotation("EPCurveToolOptions")) -command ("EPCurveToolOptions"); $cmd = "CreateBezierCurveTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("CreateBezierCurveToolOptions"); menuItem -optionBox true -image "curveBezier.png" -annotation (getRunTimeCommandAnnotation("CreateBezierCurveToolOptions")) -command ("CreateBezierCurveToolOptions"); $cmd = "PencilCurveTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("PencilCurveToolOptions"); menuItem -optionBox true -image "pencil.png" -annotation (getRunTimeCommandAnnotation("PencilCurveToolOptions")) -command ("PencilCurveToolOptions"); $cmd = "ThreePointArcTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("ThreePointArcToolOptions"); menuItem -optionBox true -image "threePointArc.png" -annotation (getRunTimeCommandAnnotation("ThreePointArcToolOptions")) -command ("ThreePointArcToolOptions"); $cmd = "TwoPointArcTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("TwoPointArcToolOptions"); menuItem -optionBox true -image "twoPointArc.png" -annotation (getRunTimeCommandAnnotation("TwoPointArcToolOptions")) -command ("TwoPointArcToolOptions"); setParent -menu ..; menuItem -divider true -ld false; } } proc ModSceneAssemblyMenuItem( string $parent ) // // Description : To create Scene Assembly menu. // { setParent -menu $parent; if(!`menuItem -exists menuCreateSceneAssembly`) { string $menuCreateSceneAssembly = "menuCreateSceneAssembly"; menuItem -label (uiRes("m_ModCreateMenu.kSceneAssemblyCreateMenu")) -subMenu true -tearOff true -postMenuCommand ("ModSceneAssemblySubMenuItems " + $menuCreateSceneAssembly) $menuCreateSceneAssembly; setParent -menu ..; if (!`exists assemblyCreate`) eval("source \"OutlinerEdRepMenu.mel\""); } int $hasAssemblyType = (size(`assembly -q -listTypes`) > 0); string $noAssemblyPlugin = !$hasAssemblyType ? (uiRes("m_ModCreateMenu.kNoSceneAssemblyPluginLoaded")) : ""; menuItem -edit -annotation $noAssemblyPlugin -enable $hasAssemblyType menuCreateSceneAssembly; } global proc ModSceneAssemblySubMenuItems( string $parent ) { setParent -menu $parent; menu -edit -deleteAllItems $parent; string $assemblyTypes[] = `assembly -q -listTypes`; if(size($assemblyTypes) > 0){ string $createLabelStr = (uiRes("m_ModCreateMenu.kCreateSceneAssemblyLabel")); string $annCreateLabelStr = (uiRes("m_ModCreateMenu.kAnnAssemblyCreateLabel")); int $i; for ($i; $i < size($assemblyTypes); $i++) { string $assemblyLabel = `assembly -q -type $assemblyTypes[$i] -label`; string $label = `format -s $assemblyLabel $createLabelStr`; string $ann = `format -s $assemblyLabel $annCreateLabelStr`; menuItem -label $label -annotation $ann -command ("assemblyCreate " + $assemblyTypes[$i]); string $optionBox = `assembly -q -createOptionBoxProc -type $assemblyTypes[$i]`; if (size($optionBox) > 0) { menuItem -optionBox true -command $optionBox; } } } setParent -menu ..; } global proc createTypeCallback() { if (`pluginInfo -q -loaded "Type"` ) { CreatePolygonType(); } } global proc createSVGCallback() { if (`pluginInfo -q -loaded "Type"` ) { CreatePolygonSVG(); } } proc ModTextMenuItem( string $parent ) // // Description : To create Text menu. // { string $cmd; setParent -menu $parent ; if (`isTrue "NurbsExists"`) { int $loaded = `pluginInfo -q -loaded "Type"`; $cmd = "CreatePolygonType"; menuItem -version "2017" -enable $loaded -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) TypeCreateTextMenuItem; $cmd = "CreatePolygonSVG"; menuItem -version "2017" -enable $loaded -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) TypeCreateSVGMenuItem; } setParent -menu ..; } proc ModIllustratorCurvesMenuItem( string $parent ) // // Description : To create curves/surfaces by reading an Adobe(R) Illustrator(R) file. // { string $cmd; setParent -menu $parent ; if (`isTrue "NurbsExists"`) { $cmd = "CreateIllustratorCurves"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragDoubleClickCommand ("CreateIllustratorCurvesOptions"); menuItem -optionBox true -image "aiObject.png" -annotation (getRunTimeCommandAnnotation("CreateIllustratorCurves")) -command ("CreateIllustratorCurvesOptions"); } setParent -menu ..; } proc ModLocatorAndConstrPlaneMenuItem( string $parent ) // // Description : // To create locator and construction plane // { string $cmd; setParent -menu $parent ; $cmd = "CreateConstructionPlane"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performCreateConstructionPlane 2") -dragDoubleClickCommand ("CreateConstructionPlaneOptions"); menuItem -optionBox true -image "sketchPlane.png" -annotation (getRunTimeCommandAnnotation("CreateConstructionPlaneOptions")) -command ("CreateConstructionPlaneOptions"); $cmd = "CreateImagePlane"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) -dragDoubleClickCommand ("CreateConstructionPlaneOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateImagePlaneOptions")) -command ("CreateImagePlaneOptions"); $cmd = "CreateLocator"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "CreateAnnotateNode"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); setParent -menu ..; } global proc defineCharacter( ) // // Procedure Name: // defineCharacter // // Description: // Creates a set using the selected items, // so that users can define all the nodes // in the DAG that make up their "characters". // // Input Arguments: // None. // // Return Value: // None. { string $OK = (uiRes("m_ModCreateMenu.kOk")); string $cancel = (uiRes("m_ModCreateMenu.kCancel")); string $toShelf = (uiRes("m_ModCreateMenu.kAddToShelf")); // Prompt the user for a new character name // string $result = `promptDialog -title (uiRes("m_ModCreateMenu.kCreateQuickSelectSet")) -message (uiRes("m_ModCreateMenu.kEnterQuickSelectSetname")) -text "Set" -button $OK -button $cancel -button $toShelf -defaultButton $OK -cancelButton $cancel -dismissString $cancel`; // If the result was "OK", then proceed // if ( $result == $OK ) { // Also, notice that the `type` is being set // to "gCharacterSet" - just trying to pick // a name that users probably won't type // string $characterName = `promptDialog -q`; string $newName; $newName = `sets -text "gCharacterSet" -name $characterName`; string $resultStr = (uiRes("m_ModCreateMenu.kCreatedQuickSet")); string $infoStr = `format -stringArg $newName $resultStr`; print $infoStr; } // If the result was "Add toShelf", then proceed // if ( $result == $toShelf ) { // Also, notice that the `type` is being set // to "gCharacterSet" - just trying to pick // a name that users probably won't type // string $characterName = `promptDialog -q`; sets -text "gCharacterSet" -name $characterName; string $cmd = "textToShelf "; $cmd += $characterName; $cmd += " \"select -replace "; $cmd += $characterName; $cmd += "\""; //textToShelf $characterName ("select -replace " + $characterName); evalEcho($cmd); } } proc ModSetsMenuItem( string $parent ) // // Description : // To create sets and other grouping things // { string $cmd; setParent -menu $parent ; // Empty Group // $cmd = "CreateEmptyGroup"; menuItem -echoCommand true -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); menuItem -label (uiRes("m_ModCreateMenu.kCreateSets")) -subMenu true -tearOff true -allowOptionBoxes true; // Sets // $cmd = "CreateSet"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) -dragDoubleClickCommand ("CreateSetOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateSetOptions")) -command ("CreateSetOptions"); $cmd = "CreatePartition"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) -dragDoubleClickCommand ("CreatePartitionOptions"); menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreatePartitionOptions")) -command ("CreatePartitionOptions"); $cmd = "CreateQuickSelectSet"; menuItem -ltVersion 2016 -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd); setParent -menu ..; } global proc ModCameraSubMenuItem( string $parent ) { string $cmd; loadPlugin -qt "stereoCamera"; popupMenu -e -deleteAllItems $parent; setParent -m $parent; $cmd = "CreateCameraOnly"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performCameraOnly 2") -dragDoubleClickCommand ("CreateCameraOnlyOptions"); menuItem -optionBox true -image "view.png" -annotation (getRunTimeCommandAnnotation("CreateCameraOnlyOptions")) -command ("CreateCameraOnlyOptions"); $cmd = "CreateCameraAim"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performCameraAim 2") -dragDoubleClickCommand ("CreateCameraAimOptions"); menuItem -optionBox true -image "cameraAim.png" -annotation (getRunTimeCommandAnnotation("CreateCameraAimOptions")) -command ("CreateCameraAimOptions"); $cmd = "CreateCameraAimUp"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd) -dragMenuCommand ("performCamera 2") -dragDoubleClickCommand ("CreateCameraAimUpOptions"); menuItem -optionBox true -image "cameraAimUp.png" -annotation (getRunTimeCommandAnnotation("CreateCameraAimUpOptions")) -command ("CreateCameraAimUpOptions"); menuItem -divider true ; python("import maya.app.stereo.stereoCameraMenus as stereoCameraMenus"); python("stereoCameraMenus.buildCreateMenu()"); } proc ModCameraMenuItem( string $parent ) // // Description ; To create a camera. { string $cmd; setParent -menu $parent ; string $label = (uiRes("m_ModCreateMenu.kCreateCameras")); string $menu = `menuItem -label $label -subMenu true -tearOff true -allowOptionBoxes true`; menuItem -edit -postMenuCommand ("ModCameraSubMenuItem "+$menu) $menu; setParent -menu ..; setParent -menu $parent ; } proc ModAssetMenuItem( string $parent ) { string $cmd; menuItem -label (uiRes("m_ModCreateMenu.kAsset")) -subMenu true -tearOff true assetItem; $cmd = "CreateContainer"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) -allowOptionBoxes true -dmc "performCreateContainer 2"; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateContainerOptions")) -c CreateContainerOptions; $cmd = "CreateDagContainer"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -command ($cmd) -allowOptionBoxes true -dmc "performCreateDagContainer 2"; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("CreateDagContainerOptions")) -c CreateDagContainerOptions; setParent -menu .. ; } proc ModMeasureToolsMenuItem( string $parent ) // // Sets up the measure tools submenu { string $cmd; menuItem -label (uiRes("m_ModCreateMenu.kCreateMeasureTools")) -subMenu true -tearOff true measureItem; $cmd = "DistanceTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "ParameterTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); $cmd = "ArcLengthTool"; menuItem -label `runTimeCommand -q -l $cmd` -annotation `runTimeCommand -q -ann $cmd` -image `runTimeCommand -q -i $cmd` -command ($cmd); setParent -menu ..; } proc updateModCreateMenu( string $parent ) { // Update Scene Assembly menu ModSceneAssemblyMenuItem( $parent ); int $loaded = `pluginInfo -q -loaded "Type"`; menuItem -edit -enable $loaded TypeCreateTextMenuItem; menuItem -edit -enable $loaded TypeCreateSVGMenuItem; } global proc ModCreateMenu( string $parent ) { if( `menu -q -ni $parent` != 0 ) { // These should be things that have to happen every time the menu is displayed. updateModCreateMenu( $parent ); } else { // This are the initial creation calls ModNurbsPrimitiveMenuItem( $parent ) ; ModPolyPrimitiveMenuItem( $parent ) ; ModSubdPrimitiveMenuItem( $parent ) ; ModVolumePrimitiveMenuItem( $parent ) ; ModLightsMenuItem( $parent ) ; ModCameraMenuItem( $parent ) ; ModCurveToolsMenuItem( $parent ) ; ModTextMenuItem( $parent ) ; ModIllustratorCurvesMenuItem( $parent ); menuItem -divider true -dividerLabel (uiRes("m_ModCreateMenu.kCreateAids")); ModLocatorAndConstrPlaneMenuItem( $parent ) ; ModMeasureToolsMenuItem( $parent ); menuItem -divider true -dividerLabel (uiRes("m_ModCreateMenu.kCreateSceneMgt")); ModSceneAssemblyMenuItem( $parent ); ModSetsMenuItem( $parent ) ; ModAssetMenuItem( $parent ); } }