// =========================================================================== // 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. // =========================================================================== // // // Creation Date: 1/13/06 // // // Description: // This creates a window with a slider for the performPolySoftEdge command // under the "Normals" menu on the "Polygons" menubar. // global proc polySoftEdgeReset() { optionVar -floatValue polySoftEdge 30.0; floatSliderGrp -edit -value 30.0 polySoftEdgeFltSlider; } global proc setPolySoftEdge( float $fval ) { optionVar -floatValue polySoftEdge $fval; polyPerformAction ("polySoftEdge -angle " + $fval) e 0; } global proc setPolySoftEdgeCallback ( string $fltSlider ) { if (`floatSliderGrp -exists $fltSlider`) { setPolySoftEdge(`floatSliderGrp -query -v $fltSlider`); } } global proc polySoftEdgeWin() { string $layout = getOptionBox(); setParent $layout; string $commandName = "polySoftEdge"; setOptionBoxCommandName($commandName); float $fval = 30.0; if( `optionVar -exists polySoftEdge` ) $fval = `optionVar -query polySoftEdge`; waitCursor -state 1; setUITemplate -pushTemplate OptionBoxTemplate; formLayout polySoftEdgeOptionsLayout; string $slider = `floatSliderGrp -field true -label (uiRes("m_polySoftEdgeWin.kAngle")) -minValue 0.0 -maxValue 180.0 -fieldMinValue 0.0 -fieldMaxValue 180.0 -value $fval -rowAttach 1 "top" 4 polySoftEdgeFltSlider`; setParent ..; setUITemplate -popTemplate; waitCursor -state 0; string $applyBtn = getOptionBoxApplyBtn(); button -edit -command ("setPolySoftEdgeCallback(\"" + $slider + "\")") $applyBtn; string $applyAndCloseBtn = getOptionBoxApplyAndCloseBtn(); button -edit -command ("setPolySoftEdgeCallback(\"" + $slider + "\"); hideOptionBox") $applyAndCloseBtn; string $resetBtn = getOptionBoxResetBtn(); button -edit -command ("polySoftEdgeReset") $resetBtn; string $closeBtn = getOptionBoxCloseBtn(); button -edit -command ("hideOptionBox") $closeBtn; setOptionBoxTitle (uiRes("m_polySoftEdgeWin.kSetNormalAngle")); showOptionBox(); }