// =========================================================================== // 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 createNurbsPlaneValues(string $toolName) { string $name = "createNurbsPlane"; string $parent = (`toolPropertyWindow -q -location` + "|" + $name); setParent $parent; int $uPatches = `createNurbsPlaneCtx -q -uPatches $toolName`; int $vPatches = `createNurbsPlaneCtx -q -vPatches $toolName`; int $axisType = `createNurbsPlaneCtx -q -axisType $toolName`; float $axis[3] = `createNurbsPlaneCtx -q -axis $toolName`; int $surfDeg = `createNurbsPlaneCtx -q -surfaceDegree $toolName`; float $w = `createNurbsPlaneCtx -q -width $toolName`; float $h = `createNurbsPlaneCtx -q -height $toolName`; int $dragEdit = `createNurbsPlaneCtx -q -doDragEdit $toolName`; // Set control values and callbacks // if( $axisType < 4 ) { radioButtonGrp -edit -select $axisType createNurbsPlaneAxisType1RadioButtonGrp; } else { radioButtonGrp -edit -select ($axisType - 3) createNurbsPlaneAxisType2RadioButtonGrp; } radioButtonGrp -edit -onCommand1 ("floatFieldGrp -e -value 1.0 0.0 0.0 0.0 createNurbsPlaneAxisFieldsFloatGrp; createNurbsPlaneCtx -edit -axisType 1 -axis 1 0 0 " + $toolName ) -onCommand2 ("floatFieldGrp -e -value 0.0 1.0 0.0 0.0 createNurbsPlaneAxisFieldsFloatGrp; createNurbsPlaneCtx -edit -axisType 2 -axis 0 1 0 " + $toolName ) -onCommand3 ("floatFieldGrp -e -value 0.0 0.0 1.0 0.0 createNurbsPlaneAxisFieldsFloatGrp; createNurbsPlaneCtx -edit -axisType 3 -axis 0 0 1 " + $toolName ) createNurbsPlaneAxisType1RadioButtonGrp; radioButtonGrp -edit -onCommand1 ("createNurbsPlaneCtx -edit -axisType 4 -axis " + "`floatFieldGrp -query -value1 createNurbsPlaneAxisFieldsFloatGrp` " + "`floatFieldGrp -query -value2 createNurbsPlaneAxisFieldsFloatGrp` " + "`floatFieldGrp -query -value3 createNurbsPlaneAxisFieldsFloatGrp` " + $toolName ) -onCommand2 ("float $axis[] = `nurbsViewDirectionVector 1`; createNurbsPlaneCtx -edit -axisType 5 -axis $axis[0] $axis[1] $axis[2] " + $toolName ) createNurbsPlaneAxisType2RadioButtonGrp; floatFieldGrp -edit -enable ($axisType == 4) -value $axis[0] $axis[1] $axis[2] 0.0 -changeCommand ("createNurbsPlaneCtx -e -axis #1 #2 #3 " + $toolName) -value1 $axis[0] -value2 $axis[1] -value3 $axis[2] createNurbsPlaneAxisFieldsFloatGrp; intSliderGrp -e -v $uPatches -cc ("createNurbsPlaneCtx -e -uPatches #1 " + $toolName) createNurbsPlaneUPatchesSlider; intSliderGrp -e -v $vPatches -cc ("createNurbsPlaneCtx -e -vPatches #1 " + $toolName) createNurbsPlaneVPatchesSlider; radioButtonGrp -edit -onCommand1 ("createNurbsPlaneCtx -e -surfaceDegree 1 " + $toolName) -onCommand2 ("createNurbsPlaneCtx -e -surfaceDegree 2 " + $toolName) -onCommand3 ("createNurbsPlaneCtx -e -surfaceDegree 3 " + $toolName) createNurbsPlaneSurfaceDegree1RadioButtonGrp; radioButtonGrp -edit -onCommand1 ("createNurbsPlaneCtx -e -surfaceDegree 5 " + $toolName) -onCommand2 ("createNurbsPlaneCtx -e -surfaceDegree 7 " + $toolName) createNurbsPlaneSurfaceDegree2RadioButtonGrp; if ($surfDeg <= 3) { radioButtonGrp -edit -select $surfDeg createNurbsPlaneSurfaceDegree1RadioButtonGrp; } else if ($surfDeg == 5) { radioButtonGrp -edit -select 1 createNurbsPlaneSurfaceDegree2RadioButtonGrp; } else if ($surfDeg == 7) { radioButtonGrp -edit -select 2 createNurbsPlaneSurfaceDegree2RadioButtonGrp; } floatSliderGrp -e -v $w -cc ("createNurbsPlaneCtx -e -width #1 " + $toolName) createNurbsPlaneWidthSlider; floatSliderGrp -e -v $h -cc ("createNurbsPlaneCtx -e -height #1 " + $toolName) createNurbsPlaneHeightSlider; checkBoxGrp -e -v1 $dragEdit -cc1 ("createNurbsPlaneCtx -e -doDragEdit " + !$dragEdit + " " + $toolName) createNurbsPlaneDragEditCheckBox; string $icon = "plane.png"; string $helpTag= "CreateNurbsPlaneTool"; toolPropertySetCommon $toolName $icon $helpTag; toolPropertySelect $name; }