// =========================================================================== // 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 createNurbsSquareValues(string $toolName) { string $name = "createNurbsSquare"; string $parent = (`toolPropertyWindow -q -location` + "|" + $name); setParent $parent; int $spans = `createNurbsSquareCtx -q -spans $toolName`; int $axisType = `createNurbsSquareCtx -q -axisType $toolName`; float $axis[3] = `createNurbsSquareCtx -q -axis $toolName`; int $surfDeg = `createNurbsSquareCtx -q -surfaceDegree $toolName`; float $w = `createNurbsSquareCtx -q -width $toolName`; float $h = `createNurbsSquareCtx -q -height $toolName`; int $dragEdit = `createNurbsSquareCtx -q -doDragEdit $toolName`; // Set control values and callbacks // if( $axisType < 4 ) { radioButtonGrp -edit -select $axisType createNurbsSquareAxisType1RadioButtonGrp; } else { radioButtonGrp -edit -select ($axisType - 3) createNurbsSquareAxisType2RadioButtonGrp; } radioButtonGrp -edit -onCommand1 ("floatFieldGrp -e -value 1.0 0.0 0.0 0.0 createNurbsSquareAxisFieldsFloatGrp; createNurbsSquareCtx -edit -axisType 1 -axis 1 0 0 " + $toolName ) -onCommand2 ("floatFieldGrp -e -value 0.0 1.0 0.0 0.0 createNurbsSquareAxisFieldsFloatGrp; createNurbsSquareCtx -edit -axisType 2 -axis 0 1 0 " + $toolName ) -onCommand3 ("floatFieldGrp -e -value 0.0 0.0 1.0 0.0 createNurbsSquareAxisFieldsFloatGrp; createNurbsSquareCtx -edit -axisType 3 -axis 0 0 1 " + $toolName ) createNurbsSquareAxisType1RadioButtonGrp; radioButtonGrp -edit -onCommand1 ("createNurbsSquareCtx -edit -axisType 4 -axis " + "`floatFieldGrp -query -value1 createNurbsSquareAxisFieldsFloatGrp` " + "`floatFieldGrp -query -value2 createNurbsSquareAxisFieldsFloatGrp` " + "`floatFieldGrp -query -value3 createNurbsSquareAxisFieldsFloatGrp` " + $toolName ) -onCommand2 ("float $axis[] = `nurbsViewDirectionVector 1`; createNurbsSquareCtx -edit -axisType 5 -axis $axis[0] $axis[1] $axis[2] " + $toolName ) createNurbsSquareAxisType2RadioButtonGrp; floatFieldGrp -edit -enable ($axisType == 4) -value $axis[0] $axis[1] $axis[2] 0.0 -changeCommand ("createNurbsSquareCtx -e -axis #1 #2 #3 " + $toolName) -value1 $axis[0] -value2 $axis[1] -value3 $axis[2] createNurbsSquareAxisFieldsFloatGrp; intSliderGrp -e -v $spans -cc ("createNurbsSquareCtx -e -spans #1 " + $toolName) createNurbsSquareSpansSlider; radioButtonGrp -edit -onCommand1 ("createNurbsSquareCtx -e -surfaceDegree 1 " + $toolName) -onCommand2 ("createNurbsSquareCtx -e -surfaceDegree 2 " + $toolName) -onCommand3 ("createNurbsSquareCtx -e -surfaceDegree 3 " + $toolName) createNurbsSquareSurfaceDegree1RadioButtonGrp; radioButtonGrp -edit -onCommand1 ("createNurbsSquareCtx -e -surfaceDegree 5 " + $toolName) -onCommand2 ("createNurbsSquareCtx -e -surfaceDegree 7 " + $toolName) createNurbsSquareSurfaceDegree2RadioButtonGrp; if ($surfDeg <= 3) { radioButtonGrp -edit -select $surfDeg createNurbsSquareSurfaceDegree1RadioButtonGrp; } else if ($surfDeg == 5) { radioButtonGrp -edit -select 1 createNurbsSquareSurfaceDegree2RadioButtonGrp; } else if ($surfDeg == 7) { radioButtonGrp -edit -select 2 createNurbsSquareSurfaceDegree2RadioButtonGrp; } floatSliderGrp -e -v $w -cc ("createNurbsSquareCtx -e -width #1 " + $toolName) createNurbsSquareWidthSlider; floatSliderGrp -e -v $h -cc ("createNurbsSquareCtx -e -height #1 " + $toolName) createNurbsSquareHeightSlider; checkBoxGrp -e -v1 $dragEdit -cc1 ("createNurbsSquareCtx -e -doDragEdit " + !$dragEdit + " " + $toolName) createNurbsSquareDragEditCheckBox; string $icon = "square.png"; string $helpTag= "CreateNurbsSquareTool"; toolPropertySetCommon $toolName $icon $helpTag; toolPropertySelect $name; }