// =========================================================================== // 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. // =========================================================================== // // Description: // Polygon UV creation menu // global proc PolygonsEditUVsMenu(string $parent) { if (! `isTrue "PolygonsExists"`) return; PolygonsEditTextureMenu $parent 0 "ls -sl"; } global proc PolygonsEditTextureMenu(string $parent, int $creator, string $selectCmd) // // Description: // Polygon Edit UVs menu // { setParent -m $parent; if (`menu -q -ni $parent` == 0) { // Normalize menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsNormalizeUVs")) -ecr true -annotation ( getRunTimeCommandAnnotation("NormalizeUVs") ) -image "polyNormalizeUVs.png" -dmc "performPolyForceUV normalize 2" -c "NormalizeUVs" normalizePolyUVsItem; menuItem -optionBox 1 -annotation ( getRunTimeCommandAnnotation("NormalizeUVsOptions") ) -image "polyNormalizeUVs.png" -ecr false -c "NormalizeUVsOptions" normalizePolyUVsOptionItem; // Unitize string $unitizeLabel = (uiRes("m_PolygonsEditUVsMenu.kPolyUVsUnitizeLabel")); string $createUnitizedUVs = (uiRes("m_PolygonsEditUVsMenu.kPolyUVsCreateUnitizedUVs")); string $prefix = ($creator == 0 ? "" : ( "PolyRequestUVSetName \"" +$createUnitizedUVs+ "\" ") ); string $cmd = $prefix + "performPolyForceUVArgList"; string $version = "\"1\""; string $args0 = ("{\"0\", \"unitize\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}"); string $args1 = ("{\"1\", \"unitize\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}"); string $args2 = ("{\"2\", \"unitize\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}"); string $suffix = ($creator == 0 ? " \"\"" : ""); string $dmc = "performPolyForceUVArgList \"1\" {\"2\", \"unitize\", \"ls -sl\", \"0\"} \"\""; string $c = ($cmd + " " + $version + " " + $args0 + $suffix); menuItem -label $unitizeLabel -ecr true -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsUnitizeUVsAnnot")) -image "polyUnitizeUVs.png" -dmc $dmc -c $c unitizePolyUVsItem; $c = ($cmd + " " + $version + " " + $args1 + $suffix); menuItem -optionBox 1 -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsUnitizeUVsOptionAnnot")) -image "polyUnitizeUVs.png" -ecr false -c $c unitizePolyUVsOptionItem; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsFlipUVs")) -ecr true -iol (uiRes("m_PolygonsEditUVsMenu.kFlipUvIconOverlay")) -annotation ( getRunTimeCommandAnnotation("FlipUVs") ) -image "polyFlipUVs.png" -dmc "performPolyForceUV flip 2" -c "FlipUVs" flipUVItem; menuItem -optionBox 1 -annotation ( getRunTimeCommandAnnotation("FlipUVsOptions") ) -image "polyFlipUVs.png" -ecr false -c "FlipUVsOptions" flipUVOptionItem; // m2.1 Rotate uvs about vertex menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsRotateUVs")) -ecr true -i "polyTextureRotateUV.png" -annotation ( getRunTimeCommandAnnotation("RotateUVs") ) -dmc "performPolyRotateUVs 2" -ddc "RotateUVsOptions" -c "RotateUVs" rotatePolyUVsUVItem; menuItem -optionBox 1 -ecr false -i "polyTextureRotateUV.png" -annotation ( getRunTimeCommandAnnotation("RotateUVsOptions") ) -c "RotateUVsOptions" rotatePolyUVsOptionItem; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsLayoutRectangle")) -ecr true -i "polyUVRectangleLarge.png" -annotation (getRunTimeCommandAnnotation("LayoutUVRectangle")) -dmc "polygonsMenuItemToShelf \"polyPerformAction polyUVRectangle v 0\"" -c "LayoutUVRectangle" layoutUVRectangleTextureItem; menuItem -divider true; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsGridUVs")) -annotation ( getRunTimeCommandAnnotation("GridUV") ) -c "GridUV" -i "polyGridUV.png"; menuItem -optionBox 1 -annotation ( getRunTimeCommandAnnotation("GridUVOptions") ) -c "GridUVOptions" -ecr false -i "polyGridUV.png"; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsAlignUVs")) -c "AlignUV" -annotation ( getRunTimeCommandAnnotation("AlignUV") ) -image "polyAlignUVs.png" ; menuItem -optionBox true -annotation ( getRunTimeCommandAnnotation("AlignUVOptions") ) -image "polyAlignUVs.png" -ecr false -c "AlignUVOptions" ; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsWarpImage")) -annotation ( getRunTimeCommandAnnotation("WarpImage") ) -echoCommand true -dragMenuCommand "WarpImageOptions" -c "WarpImageOptions" -i "polyWarpImage.png" layoutPolyUVsWarpImageItem; menuItem -divider true; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsMapUVBorder")) -ecr true -i "polyMapUVBorder.png" -annotation ( getRunTimeCommandAnnotation("MapUVBorder") ) -ddc "performPolyUntangleUV map 1" -dmc "performPolyUntangleUV map 2" -c "MapUVBorder" mapUVBorderItem; menuItem -optionBox 1 -i "polyMapUVBorder.png" -annotation ( getRunTimeCommandAnnotation("MapUVBorderOptions") ) -ecr false -c "MapUVBorderOptions" mapPolyUVsBorderOptionItem; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsStraightenUVBorder")) -annotation ( getRunTimeCommandAnnotation("StraightenUVBorder") ) -i "polyStraightenUVBorder.png" -c "StraightenUVBorder"; menuItem -optionBox 1 -annotation ( getRunTimeCommandAnnotation("StraightenUVBorderOptions") ) -i "polyStraightenUVBorder.png" -c "StraightenUVBorderOptions" -ecr false; menuItem -divider true; // relax, unfold and layout menuItem -label (uiRes("m_PolygonsEditUVsMenu.kOptimizeUVs")) -ecr true -version "2015" -i "polyRelaxUVShell.png" -annotation ( getRunTimeCommandAnnotation("OptimzeUVs") ) -c "OptimzeUVs"; menuItem -optionBox 1 -i "polyRelaxUVShell.png" -annotation ( getRunTimeCommandAnnotation("OptimzeUVsOptions") ) -ecr false -c "OptimzeUVsOptions"; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsUnfoldUVs")) -version "2015" -annotation ( getRunTimeCommandAnnotation("UnfoldUV") ) -dragMenuCommand "performUnfold 2" -c "UnfoldUV" -i "textureEditorUnfoldUVsLarge.png" unfoldPolyUVsItem; menuItem -optionBox true -annotation ( getRunTimeCommandAnnotation("UnfoldUVOptions") ) -c "UnfoldUVOptions" -ecr false -i "textureEditorUnfoldUVsLarge.png" unfoldPolyUVsOptItem; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsLayoutUVs")) -version "2017" -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsLayoutUVsAnnot")) -c "performPolyLayoutUV 0" -i "polyLayoutUVLarge.png"; menuItem -optionBox 1 -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsLayoutUVsOptionAnnot")) -c "performPolyLayoutUV 1" -ecr false -i "polyLayoutUVLarge.png"; menuItem -divider true; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kAutoSeamUVs")) -version "2018" -annotation (uiRes("m_PolygonsEditUVsMenu.kAutoSeamUVsAnnot")) -i "polyAutoSeamsLarge.png" -c "performPolyAutoSeamUV 0" autoSeamUVsItem; menuItem -optionBox 1 -annotation (uiRes("m_PolygonsEditUVsMenu.kAutoSeamUVsOptionsAnnot")) -i "polyAutoSeamsLarge.png" -c "performPolyAutoSeamUV 1" -ecr false; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsCutUVs")) -ecr true -i "polyMapCut.png" -annotation ( getRunTimeCommandAnnotation ( "CutUVs" ) ) -dmc "polygonsMenuItemToShelf \"polyPerformAction polyMapCut e 0\"" -c "CutUVs" cutPolyUVsTextureItem; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsSplitUVs")) -ecr true -i "polySplitUVs.png" -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsSplitUVsAnnot")) -c "polySplitTextureUV" splitPolyUVsTextureItem; $cmd = "SewUVs"; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsSewUVs")) -ecr true -i "polyMapSew.png" -annotation (getRunTimeCommandAnnotation($cmd)) -dmc "polygonsMenuItemToShelf \"polyPerformAction polyMapSew e 0\"" -c $cmd sewPolyUVsTextureItem; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsMoveAndSewUVs")) -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsMoveAndSewUVsAnnot")) -c "performPolyMapSewMove 0" -i "polyMoveSew.png"; menuItem -optionBox 1 -annotation (uiRes("m_PolygonsEditUVsMenu.kPolyUVsMoveAndSewUVsOptionAnnot")) -c "performPolyMapSewMove 1" -ecr false -i "polyMoveSew.png"; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsMergeUVs")) -annotation ( getRunTimeCommandAnnotation ( "MergeUV" ) ) -c "MergeUV" -i "polyMergeUV.png" ; menuItem -optionBox 1 -annotation ( getRunTimeCommandAnnotation ( "MergeUVOptions" ) ) -c "MergeUVOptions" -ecr false -i "polyMergeUV.png" ; menuItem -label (uiRes("m_PolygonsEditUVsMenu.kPolyUVsDeleteUVs")) -ecr true -i "polyMapDel.png" -annotation (getRunTimeCommandAnnotation("DeleteUVs")) -dmc "polygonsMenuItemToShelf \"polyPerformAction polyMapDel f 0\"" -c "DeleteUVs" delPolyUVsTextureItem; menuItem -divider true; $cmd = "TextureViewWindow"; menuItem -enableCommandRepeat false -label (uiRes("m_PolygonsEditUVsMenu.kUVTextureEditor")) -annotation (getRunTimeCommandAnnotation($cmd)) -image "textureEditor.png" -command $cmd; setParent -m ..; } }