// =========================================================================== // 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: // nurbsToPolySetup // // Description: // Update the state of the option box UI to reflect the option values. // // Input Arguments: // parent - Top level parent layout of the option box UI. // Required so that UI object names can be // successfully resolved. // // forceFactorySettings - Whether the option values should be set to // default values. // // Return Value: // None. // proc setOptionVars( int $forceFactorySettings ) { if( $forceFactorySettings ) { nurbsToPolygonsPref -format 1 -matchRenderTessellation 0 -merge 0 -mergeTolerance 0.1 -polyType 0 -polyCount 200 -chr 0.1 -ft 0.01 -mel 0.001 -d 0.1 -uType 1 -uNumber 3 -vType 1 -vNumber 3 -useChordHeight 0 -chordHeight 1 -useChordHeightRatio 0 -edgeSwap 0; } } global proc nurbsToPolySetup( string $parent, int $forceFactorySettings ) { // Retrieve the option settings // setParent $parent; setOptionVars( $forceFactorySettings ); int $formatValue; int $localIntValue; float $localFloatValue; // There are now 2 radio button groups called format and format2 // $formatValue = `nurbsToPolygonsPref -q -format`; switch( $formatValue ) { case 0: radioButtonGrp -e -sl 2 format; break; case 1: radioButtonGrp -e -sl 1 format2; break; case 2: radioButtonGrp -e -sl 1 format; break; case 3: radioButtonGrp -e -sl 2 format2; break; default: radioButtonGrp -e -sl 1 format2; break; } $localIntValue = `nurbsToPolygonsPref -q -merge`; if( ($localIntValue < 0) || ($localIntValue > 1) ) { $localIntValue = 0; } // // Make sure that the attach mesh option is not selected at the // same time as any of the tessellation methods that it dosn't // work with. For now this is just the control points method. // If it is then just turn off the attach option and leave // whatever tessellation method is chosen alone. // if ($localIntValue && $formatValue == 3) { $localIntValue = 0; } checkBoxGrp -e -v1 $localIntValue mergeBox; $localFloatValue = `nurbsToPolygonsPref -q -mergeTolerance`; if( $localFloatValue < 0 ) { $localFloatValue = 0.1; } floatSliderGrp -e -value $localFloatValue mergeTolerance; // The tolerance slider should only be enabled if the // attach mesh option is chosen. // floatSliderGrp -edit -enable $localIntValue mergeTolerance; $localIntValue = `nurbsToPolygonsPref -q -matchRenderTessellation`; if( ($localIntValue < 0) || ($localIntValue > 1) ) { $localIntValue = 0; } checkBoxGrp -e -v1 $localIntValue matchRenderTessellationBox; $localIntValue = `nurbsToPolygonsPref -q -polyType`; if( ($localIntValue < 0) || ($localIntValue > 1) ) { $localIntValue = 0; } radioButtonGrp -e -sl ($localIntValue+1) type; $localIntValue = `nurbsToPolygonsPref -q -polyCount`; intSliderGrp -e -v $localIntValue count; $localFloatValue = `nurbsToPolygonsPref -q -chr`; floatSliderGrp -e -v $localFloatValue ratioG; floatSliderGrp -e -v $localFloatValue ratioS; $localFloatValue = `nurbsToPolygonsPref -q -ft`; floatSliderGrp -e -v $localFloatValue fractional; $localFloatValue = `nurbsToPolygonsPref -q -mel`; floatSliderGrp -e -v $localFloatValue minEdgeLength; $localFloatValue = `nurbsToPolygonsPref -q -d`; floatSliderGrp -e -v $localFloatValue delta; $localIntValue = `nurbsToPolygonsPref -q -uType`; optionMenuGrp -e -sl ($localIntValue) uType; $localIntValue = `nurbsToPolygonsPref -q -uNumber`; intSliderGrp -e -v $localIntValue uNumber; $localIntValue = `nurbsToPolygonsPref -q -vType`; optionMenuGrp -e -sl ($localIntValue) vType; $localIntValue = `nurbsToPolygonsPref -q -vNumber`; intSliderGrp -e -v $localIntValue vNumber; $localIntValue = `nurbsToPolygonsPref -q -useChordHeight`; checkBoxGrp -e -v1 $localIntValue useChordHeight; $localFloatValue = `nurbsToPolygonsPref -q -chordHeight`; floatSliderGrp -e -v $localFloatValue chordHeight; $localIntValue = `nurbsToPolygonsPref -q -useChordHeightRatio`; checkBoxGrp -e -v1 $localIntValue useChordHeightRatio; $localIntValue = `nurbsToPolygonsPref -q -edgeSwap`; checkBoxGrp -e -v1 $localIntValue edgeSwap; nurbsToPolyVisibility $parent $formatValue; }