// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // nurbsToPolyCallback // // Description: // Update the option values with the current state of the option box UI. // // Input Arguments: // parent - Top level parent layout of the option box UI. Required so // that UI object names can be successfully resolved. // // doIt - Whether the command should execute. // // Return Value: // None. // global proc nurbsToPolyCallback(string $parent, int $doIt) { setParent $parent; int $formatButton = `radioButtonGrp -q -sl format`; int $formatValue = 1; switch( $formatButton ) { case 1: $formatValue = 2; break; case 2: $formatValue = 0; break; } int $formatButton2 = `radioButtonGrp -q -sl format2`; switch( $formatButton2 ) { case 1: $formatValue = 1; break; case 2: $formatValue = 3; break; } nurbsToPolygonsPref -format $formatValue; nurbsToPolygonsPref -matchRenderTessellation (`checkBoxGrp -q -v1 matchRenderTessellationBox`); nurbsToPolygonsPref -merge (`checkBoxGrp -q -v1 mergeBox`); nurbsToPolygonsPref -mergeTolerance (`floatSliderGrp -q -value mergeTolerance`); nurbsToPolygonsPref -polyType (`radioButtonGrp -q -sl type` - 1); nurbsToPolygonsPref -polyCount (`intSliderGrp -q -v count`); if( $formatValue == 1 ) { // Format is "Standard Fit" nurbsToPolygonsPref -chr (`floatSliderGrp -q -v ratioS`); } else { nurbsToPolygonsPref -chr (`floatSliderGrp -q -v ratioG`); } nurbsToPolygonsPref -ft (`floatSliderGrp -q -v fractional`); nurbsToPolygonsPref -mel (`floatSliderGrp -q -v minEdgeLength`); nurbsToPolygonsPref -d (`floatSliderGrp -q -v delta`); nurbsToPolygonsPref -uType (`optionMenuGrp -q -sl uType`); nurbsToPolygonsPref -uNumber (`intSliderGrp -q -v uNumber`); nurbsToPolygonsPref -vType (`optionMenuGrp -q -sl vType`); nurbsToPolygonsPref -vNumber (`intSliderGrp -q -v vNumber`); nurbsToPolygonsPref -useChordHeight (`checkBoxGrp -q -v1 useChordHeight`); nurbsToPolygonsPref -chordHeight (`floatSliderGrp -q -v chordHeight`); nurbsToPolygonsPref -useChordHeightRatio (`checkBoxGrp -q -v1 useChordHeightRatio`); nurbsToPolygonsPref -edgeSwap (`checkBoxGrp -q -v1 edgeSwap`); if ($doIt) { performnurbsToPoly 0; addToRecentCommandQueue "performnurbsToPoly 0" "Nurbs To Polygons"; } }