// =========================================================================== // 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: April 12 1996 // // Description: // These procs helps to create the controls for Sketch, // curve with CVs and curve with EPs tools. // property sheet. See also curveValues.mel for procs that set // the state of the property sheet. // // Input Arguments: // None. // // Return Value: // None. // proc curveSetCallbacks (string $parent, string $type, string $ctxCmd) { // // Description: // Set the callbacks for all of the controls in the dialog. // Modifying the context will force curveValues() to be called // to update the state of the property sheet. // // setParent $parent; if( $type == "curveCV" || $type == "curveEP" ) { radioButtonGrp -e -on1 ($ctxCmd + " -e -d 1 -bez 0 `currentCtx`") -on2 ($ctxCmd + " -e -d 2 -bez 0 `currentCtx`") curveDegreeRadio1; radioButtonGrp -e -on1 ($ctxCmd + " -e -d 3 -bez 0 `currentCtx`") -on2 ($ctxCmd + " -e -d 3 -bez 1 `currentCtx`") curveDegreeRadio2; radioButtonGrp -e -on1 ($ctxCmd + " -e -d 5 -bez 0 `currentCtx`") -on2 ($ctxCmd + " -e -d 7 -bez 0 `currentCtx`") curveDegreeRadio3; } else { // Curve sketch only supports degree 1 and 3 radioButtonGrp -e -on1 ($ctxCmd + " -e -d 1 -bez 0 `currentCtx`") -on2 ($ctxCmd + " -e -d 3 -bez 0 `currentCtx`") curveDegreeRadio1; } // Set callback for "Multiple End Knots" // if( $type == "curveCV" ) { checkBoxGrp -e -cc1 ($ctxCmd + " -e -me #1 `currentCtx`") curveCVMEKBox; } // Set call back for chord length vs. uniform parameterization // if( $type == "curveCV" || $type == "curveEP" ) { radioButtonGrp -e -on1 ($ctxCmd + " -e -un on `currentCtx`") -on2 ($ctxCmd + " -e -un off `currentCtx`") curveKnotTypeRadio1; } if ( $type == "drawExtrudeFacet" ) { intFieldGrp -edit -changeCommand ($ctxCmd + " -edit -divisions `intFieldGrp -query -value1 drawExtDivsField` `currentCtx`") drawExtDivsField; checkBoxGrp -edit -changeCommand ($ctxCmd + " -edit -facesTogether `checkBoxGrp -query -value1 drawExtFacesTogetherBox` `currentCtx`") drawExtFacesTogetherBox; } } global proc curveProperties (string $type, string $ctxCmd) { // // Description: // This procedure builds the property sheet and assigns callbacks to // its controls. The state of the controls are set in curveCVValues(). // // setUITemplate -pushTemplate OptionsTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true $type; string $curvesettings = (uiRes("m_curveProperties.kCurveSettings")); if(`about -mac`) { frameLayout -bv true -width 400 -cll true -collapse false -label $curvesettings geometryOptions_F; } else { frameLayout -bv true -cll true -collapse false -label $curvesettings geometryOptions_F; } columnLayout geometryOptions_L; string $curvedegree = (uiRes("m_curveProperties.kCurveDegree")); string $linear = (uiRes("m_curveProperties.kOption1Linear")); if( $type == "curveCV" || $type == "curveEP" ) { radioButtonGrp -nrb 2 -label $curvedegree -label1 $linear -label2 (uiRes("m_curveProperties.kOption2")) curveDegreeRadio1; radioButtonGrp -nrb 2 -scl curveDegreeRadio1 -label1 (uiRes("m_curveProperties.kOption3Cubic")) -label2 (uiRes("m_curveProperties.kOption3Bezier")) curveDegreeRadio2; radioButtonGrp -nrb 2 -scl curveDegreeRadio1 -label1 (uiRes("m_curveProperties.kOption5")) -label2 (uiRes("m_curveProperties.kOption7")) curveDegreeRadio3; radioButtonGrp -nrb 2 -label (uiRes("m_curveProperties.kKnotSpacing")) -label1 (uiRes("m_curveProperties.kUniform")) -label2 (uiRes("m_curveProperties.kChordLength")) curveKnotTypeRadio1; } else { // curve sketch only supports degree 1 & 3. radioButtonGrp -nrb 2 -label $curvedegree -label1 $linear -label2 (uiRes("m_curveProperties.kOption3")) curveDegreeRadio1; } if( $type == "curveCV" ) { checkBoxGrp -label "" -ncb 1 -label1 (uiRes("m_curveProperties.kMultipleEndKnots")) curveCVMEKBox; } if( $type == "drawExtrudeFacet" ) { intFieldGrp -label (uiRes("m_curveProperties.kDivisions")) drawExtDivsField; checkBoxGrp -ncb 1 -label (uiRes("m_curveProperties.kKeepFacesTogether")) -label1 "" drawExtFacesTogetherBox; } setParent ..; setParent ..; setParent ..; curveSetCallbacks ($parent,$type,$ctxCmd); setUITemplate -popTemplate; }