// =========================================================================== // 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 polyBevelInvertCallback ( string $node ) { setAttr ($node+".autoFit") 0; float $roundness = -1.0 * (`getAttr ($node+".roundness")`); if ($roundness < -1.0) $roundness = -1.0; setAttr ($node+".roundness") $roundness; } global proc polyBevelOptionsPopup( string $node ) { string $shEdgeLabel = (uiRes("m_polyBevelOptionsPopup.kSoftenHardenLabel")); string $sEdgeLabel = (uiRes("m_polyBevelOptionsPopup.kSoftenLabel")); string $hEdgeLabel = (uiRes("m_polyBevelOptionsPopup.kHardenLabel")); string $sEdgeCommand = ("setAttr " + $node + ".smoothingAngle 180"); string $hEdgeCommand = ("setAttr " + $node + ".smoothingAngle 0"); string $uvOrigLabel = (uiRes("m_polyBevelOptionsPopup.kUVOriginalLabel")); string $uvProjLabel = (uiRes("m_polyBevelOptionsPopup.kUVProjectLabel")); string $autoFitLabel = (uiRes("m_polyBevelOptionsPopup.kAutoFit")); int $autoFitValue = `getAttr ($node + ".autoFit")`; string $autoFitCommand = ("setAttr " + $node + ".autoFit #1"); string $numSegmentsLabel = (uiRes("m_polyBevelOptionsPopup.kNumSegments")); string $invertLabel = (uiRes("m_polyBevelOptionsPopup.kInvertBevel")); menuItem -label $autoFitLabel -command $autoFitCommand -radialPosition "N" -checkBox ($autoFitValue) ; 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 $numSegmentsLabel -radialPosition "SW" -subMenu 1 ; menuItem -label (uiRes("m_polyBevelOptionsPopup.kOne")) -command ("setAttr " + $node + ".segments 1") -radialPosition "SW" ; menuItem -label (uiRes("m_polyBevelOptionsPopup.kThree")) -command ("setAttr " + $node + ".segments 3") -radialPosition "NW" ; menuItem -label (uiRes("m_polyBevelOptionsPopup.kFive")) -command ("setAttr " + $node + ".segments 5") -radialPosition "NE" ; menuItem -label (uiRes("m_polyBevelOptionsPopup.kSeven")) -command ("setAttr " + $node + ".segments 7") -radialPosition "SE" ; setParent -m ..; menuItem -label $invertLabel -command ("polyBevelInvertCallback " + $node) -radialPosition "S" ; }