// =========================================================================== // 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. // =========================================================================== // // Create popup menu for polySelectEdit tool options // global proc polySelectEditOptionsPopup() { string $toolName = `currentCtx`; // Parent menu already set when this function is called, // so just add a menu items int $mode = `polySelectEditCtx -q -mode $toolName`; int $auto = `polySelectEditCtx -q -ac $toolName`; int $splitType = `polySelectEditCtx -q -splitType $toolName`; int $edgeFlow = `polySelectEditCtx -q -insertWithEdgeFlow $toolName`; string $autoCompleteLabel = (uiRes("m_polySelectEditOptionsPopup.kAutoComplete")); string $absoluteOffsetLabel = (uiRes("m_polySelectEditOptionsPopup.kAbsoluteOffset")); string $relativeOffsetLabel = (uiRes("m_polySelectEditOptionsPopup.kRelativeOffset")); string $shEdgeLabel = (uiRes("m_polySelectEditOptionsPopup.kSoftenHardenLabel")); string $sEdgeLabel = (uiRes("m_polySelectEditOptionsPopup.kSoftenLabel")); string $hEdgeLabel = (uiRes("m_polySelectEditOptionsPopup.kHardenLabel")); string $edgeFlowLabel = (uiRes("m_polySelectEditOptionsPopup.kEdgeFlow")); string $sEdgeCommand = ("polySelectEditCtx -e -smoothingAngle 180 " + $toolName); string $hEdgeCommand = ("polySelectEditCtx -e -smoothingAngle 0 " + $toolName); if ($mode == 0) { int $de = `polySelectEditCtx -q -deleteEdge $toolName`; string $deleteEdgeLabel = (uiRes("m_polySelectEditOptionsPopup.kDeleteEdge")); menuItem -l $autoCompleteLabel -rp "W" -cb $auto -c ("polySelectEditCtx -e -ac " + !$auto + " " + $toolName); menuItem -l $deleteEdgeLabel -rp "N" -cb $de -c ("polySelectEditCtx -e -deleteEdge " + !$de + " " + $toolName); menuItem -l $absoluteOffsetLabel -rp "E" -cb ($splitType == 0) -c ("polySelectEditCtx -e -splitType 0 " + $toolName); menuItem -l $relativeOffsetLabel -rp "S" -cb ($splitType == 1) -c ("polySelectEditCtx -e -splitType 1 " + $toolName); } else if ($mode == 1) { int $fixQuads = `polySelectEditCtx -q -fixQuads $toolName`; string $multipleSplitsLabel = (uiRes("m_polySelectEditOptionsPopup.kMultipleSplits")); string $fixQuadsLabel = (uiRes("m_polySelectEditOptionsPopup.kFixQuads")); string $numSplitsLabel = (uiRes("m_polySelectEditOptionsPopup.kNumSplitsLabel")); menuItem -l $autoCompleteLabel -rp "W" -cb $auto -c ("polySelectEditCtx -e -ac " + !$auto + " " + $toolName); menuItem -l $fixQuadsLabel -rp "NW" -cb $fixQuads -c ("polySelectEditCtx -e -fixQuads #1 " + $toolName); menuItem -l $absoluteOffsetLabel -rp "N" -cb ($splitType == 0) -c ("polySelectEditCtx -e -splitType 0 " + $toolName); menuItem -l $relativeOffsetLabel -rp "E" -cb ($splitType == 1) -c ("polySelectEditCtx -e -splitType 1 " + $toolName); menuItem -l $multipleSplitsLabel -rp "S" -cb ($splitType == 2) -c ("polySelectEditCtx -e -splitType 2 " + $toolName); menuItem -label $numSplitsLabel -radialPosition "SW" -subMenu 1 ; menuItem -label (uiRes("m_polySelectEditOptionsPopup.kOne")) -command ("polySelectEditCtx -e -divisions 1 -splitType 2 " + $toolName) -radialPosition "SW" ; menuItem -label (uiRes("m_polySelectEditOptionsPopup.kTwo")) -command ("polySelectEditCtx -e -divisions 2 -splitType 2 " + $toolName) -radialPosition "NW" ; menuItem -label (uiRes("m_polySelectEditOptionsPopup.kThree")) -command ("polySelectEditCtx -e -divisions 3 -splitType 2 " + $toolName) -radialPosition "NE" ; menuItem -label (uiRes("m_polySelectEditOptionsPopup.kFour")) -command ("polySelectEditCtx -e -divisions 4 -splitType 2 " + $toolName) -radialPosition "SE" ; setParent -m ..; } menuItem -label $shEdgeLabel -radialPosition "SE" -subMenu 1 ; menuItem -label $sEdgeLabel -command $sEdgeCommand -radialPosition "SE" ; menuItem -label $hEdgeLabel -command $hEdgeCommand -radialPosition "NE" ; setParent -m ..; menuItem -label $edgeFlowLabel -checkBox $edgeFlow -radialPosition "NE" -command ("polySelectEditCtx -e -insertWithEdgeFlow " + !$edgeFlow + " " + $toolName); ; }