// =========================================================================== // 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 colorSetMenuItems( string $parent ) { string $menuNames[]; string $prefix = ""; buildColorSetMenuNames($menuNames); buildColorSetMenu($parent, $menuNames, $prefix, 0); } global proc refreshPolyColorsMenu( string $parent ) // // Description: // Refresh Polygon color editing menu // { int $mentalIsLoaded = 0; string $renderer; for ($renderer in `renderer -query -namesOfAvailableRenderers`) { if( $renderer == "mentalRay" ) { $mentalIsLoaded = 1; break; } } menuItem -edit -enable $mentalIsLoaded mentalPrelightItem; menuItem -edit -enable $mentalIsLoaded mentalPrelightOptionsItem; } global proc PolyColorsMenu (string $parent, int $creator, string $selectCmd) // // Procedure Name: // PolyColorsMenu // // Description: // Helper method to generate the menu items for the texture menus // // Input Arguments: // string $parent The name of the parent widget // int $creator Which creator is calling this // Current known creators // 0 Edit Polygons->Colors // string $selectCmd The command to issue to determine which objects // to affect // // Return Value: // None. // { // Some of the menu items call the colorSetEditCmd with their -command flags. // colorSetEditCmd is shared with the color set editor and expects a // scrollList as a flag. There is no scrollList here so just pass an empty // string. setParent -menu $parent; menuItem -checkBox false -label1 (uiRes("m_PolyColorsMenu.kConvertDisplay")) -annotation (uiRes("m_PolyColorsMenu.kConvertDisplayAnnot")) -enableCommandRepeat false -command "toggleAutoShowColorPerVertex" toggleAutoShowColorPerVertexItem; menuItem -divider true; menuItem -l (uiRes("m_PolyColorsMenu.kCreateEmptyColorSet")) -ecr true -i "polyColorSetCreateEmpty.png" -annotation (uiRes("m_PolyColorsMenu.kCreateEmptyColorSetAnnot")) // -c $c; // -command "colorSetEditCmd new none"; -command "createEmptyColorSet 0" -dragMenuCommand "createEmptyColorSet 0" -dragDoubleClickCommand "createEmptyColorSet 1"; menuItem -optionBox true -label (uiRes("m_PolyColorsMenu.kCreateEmptyColorSetOption")) -image "polyColorSetCreateEmpty.png" -command "createEmptyColorSet 1"; menuItem -label (uiRes("m_PolyColorsMenu.kRenameCurrentColorSet")) -ecr true -enable true -i "polyColorSetRename.png" -annotation (uiRes("m_PolyColorsMenu.kRenameCurrentColorSetAnnot")) -command "colorSetEditCmd rename none"; menuItem -label (uiRes("m_PolyColorsMenu.kDeleteCurrentColorSet")) -ecr true -enable true -i "polyColorSetDelete.png" -annotation (uiRes("m_PolyColorsMenu.kDeleteCurrentColorSetAnnot")) -command "colorSetEditCmd delete none"; menuItem -label (uiRes("m_PolyColorsMenu.kColorSetEditor")) -ecr true -enable true // -ann (getRunTimeCommandAnnotation("ColorSetEditor")) -command "colorSetEditor" ; menuItem -divider true; menuItem -label (uiRes("m_PolyColorsMenu.kApplyColor")) -annotation (getRunTimeCommandAnnotation("PolygonApplyColor")) -image "polyApplyColor.png" -command "PolygonApplyColor" -dragMenuCommand "performApplyColor 2" -dragDoubleClickCommand "PolygonApplyColorOptions" ; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("PolygonApplyColorOptions")) -image "polyApplyColor.png" -command "PolygonApplyColorOptions" ; menuItem -label (uiRes("m_PolyColorsMenu.kPrelightMayaSoftware")) -annotation (uiRes("m_PolyColorsMenu.kPrelightMayaSoftwareAnnot")) -command ("performPrelight " + 0) -dragMenuCommand ("performPrelight " + 2) -dragDoubleClickCommand ("performPrelight " + 1) ; menuItem -optionBox true -annotation (uiRes("m_PolyColorsMenu.kPrelightMayaSwOptionAnnot")) -command ("performPrelight " + 1) ; menuItem -label (uiRes("m_PolyColorsMenu.kPrelightMentalRay")) -annotation (uiRes("m_PolyColorsMenu.kPrelightMentalRayAnnot")) -command ("mrBakeToVertices " + 0) -dragMenuCommand ("mrBakeToVertices " + 2) -dragDoubleClickCommand ("mrBakeToVertices " + 1) mentalPrelightItem ; menuItem -optionBox true -annotation (uiRes("m_PolyColorsMenu.kPrelightMentalRayOptionAnnot")) -command ("mrBakeToVertices " + 1) mentalPrelightOptionsItem ; menuItem -label (uiRes("m_PolyColorsMenu.kSetVertexColorKey")) -annotation (uiRes("m_PolyColorsMenu.kSetVertexColorKeyAnnot")) -command "setPolyColorKeyframe" ; menuItem -label (uiRes("m_PolyColorsMenu.kPaintVertexColorTool")) -annotation (getRunTimeCommandAnnotation("PaintVertexColorTool")) -image "paintVertexColour.png" -command "PaintVertexColorTool" -dragDoubleClickCommand "PaintVertexColorToolOptions" ; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("PaintVertexColorToolOptions")) -image "paintVertexColour.png" -command "PaintVertexColorToolOptions" ; menuItem -edit -checkBox `optionVar -query polyAutoShowColorPerVertex` toggleAutoShowColorPerVertexItem; }