// =========================================================================== // 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: 5 May 1997 // // Description: // This script defines the option box for the NURBS cylinder menu item. // // // Procedure Name: // setOptionVars // // Description: // Initialize the option values. // // Input Arguments: // Whether to set the options to default values. // // Return Value: // None. // proc setOptionVars(int $forceFactorySettings) { if( $forceFactorySettings || !`optionVar -exists nurbsCylinderGroupCaps`){ optionVar -intValue nurbsCylinderGroupCaps true; } if( $forceFactorySettings || !`optionVar -exists nurbsCylinderUseGlobalTolerance`){ optionVar -intValue nurbsCylinderUseGlobalTolerance false; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderPivotType`) { optionVar -intValue nurbsCylinderPivotType 1; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderPivotX`) { optionVar -floatValue nurbsCylinderPivotX 0.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderPivotY`) { optionVar -floatValue nurbsCylinderPivotY 0.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderPivotZ`) { optionVar -floatValue nurbsCylinderPivotZ 0.0; } string $isitYup = `upAxis -q -ax`; if( "y" == $isitYup ) { if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisType`) { optionVar -intValue nurbsCylinderAxisType 2; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisX`) { optionVar -floatValue nurbsCylinderAxisX 0.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisY`) { optionVar -floatValue nurbsCylinderAxisY 1.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisZ`) { optionVar -floatValue nurbsCylinderAxisZ 0.0; } } else { if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisType`) { optionVar -intValue nurbsCylinderAxisType 3; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisX`) { optionVar -floatValue nurbsCylinderAxisX 0.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisY`) { optionVar -floatValue nurbsCylinderAxisY 0.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderAxisZ`) { optionVar -floatValue nurbsCylinderAxisZ 1.0; } } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderStartSweep`) { optionVar -floatValue nurbsCylinderStartSweep 0.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderEndSweep`) { optionVar -floatValue nurbsCylinderEndSweep 360.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderRadius`) { optionVar -floatValue nurbsCylinderRadius 1.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderHeightRatio`) { optionVar -floatValue nurbsCylinderHeightRatio 2.0; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderDegree`) { optionVar -intValue nurbsCylinderDegree 3; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderUseTolerance`) { optionVar -intValue nurbsCylinderUseTolerance false; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderTolerance`) { optionVar -floatValue nurbsCylinderTolerance 0.01; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderSections`) { optionVar -intValue nurbsCylinderSections 8; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderSpans`) { optionVar -intValue nurbsCylinderSpans 1; } if ($forceFactorySettings || !`optionVar -exists nurbsCylinderCaps`) { optionVar -intValue nurbsCylinderCaps 0; } } // // Procedure Name: // nurbsCylinderSetup // // 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. // global proc nurbsCylinderSetup(string $parent, int $forceFactorySettings) { // Retrieve the option settings // setOptionVars($forceFactorySettings); setParent $parent; // Query the optionVar's and set the values into the controls. // Pivot // int $pivotType = `optionVar -q nurbsCylinderPivotType`; float $pivotX = `optionVar -q nurbsCylinderPivotX`; float $pivotY = `optionVar -q nurbsCylinderPivotY`; float $pivotZ = `optionVar -q nurbsCylinderPivotZ`; if ($pivotType == 1) { $pivotX = 0; $pivotY = 0; $pivotZ = 0; } radioButtonGrp -e -select $pivotType nurbsCylinderPivotType; floatFieldGrp -e -v1 $pivotX -v2 $pivotY -v3 $pivotZ nurbsCylinderPivot; // Axis // int $axisType = `optionVar -q nurbsCylinderAxisType`; float $axis[3]; switch($axisType) { case 1: $axis[0] = 1; $axis[1] = 0; $axis[2] = 0; break; case 2: $axis[0] = 0; $axis[1] = 1; $axis[2] = 0; break; case 3: $axis[0] = 0; $axis[1] = 0; $axis[2] = 1; break; case 4: $axis[0] = `optionVar -q nurbsCylinderAxisX`; $axis[1] = `optionVar -q nurbsCylinderAxisY`; $axis[2] = `optionVar -q nurbsCylinderAxisZ`; break; case 5: $axis = `nurbsViewDirectionVector 1`; break; } if( $axisType < 4 ) { radioButtonGrp -e -select $axisType nurbsCylinderAxisType1; } else { radioButtonGrp -e -select ($axisType - 3) nurbsCylinderAxisType2; } floatFieldGrp -e -v1 $axis[0] -v2 $axis[1] -v3 $axis[2] nurbsCylinderAxis; // Sweep Angle (Start and End) // floatSliderGrp -e -v `optionVar -q nurbsCylinderStartSweep` nurbsCylinderStartSweep; floatSliderGrp -e -v `optionVar -q nurbsCylinderEndSweep` nurbsCylinderEndSweep; // Radius // float $radius = `optionVar -q nurbsCylinderRadius`; floatSliderGrp -e -v $radius nurbsCylinderRadius; // Height Ratio // float $ratio = `optionVar -q nurbsCylinderHeightRatio`; floatSliderGrp -e -v `nurbsRatioConvert $radius $ratio false` nurbsCylinderHeight; // Degree // int $degree = `optionVar -q nurbsCylinderDegree`; int $degreeBtn; switch($degree) { case 1: $degreeBtn = 1; break; case 3: $degreeBtn = 2; break; } radioButtonGrp -e -select $degreeBtn nurbsCylinderDegree; int $groupCaps = `optionVar -q nurbsCylinderGroupCaps`; checkBoxGrp -e -v1 $groupCaps nurbsCylinderGroupCapsWidget; // Tolerance // int $useGlobalTol = `optionVar -q nurbsCylinderUseGlobalTolerance`; int $useTolerance = `optionVar -q nurbsCylinderUseTolerance`; if( $useTolerance ) { if( $useGlobalTol ) { radioButtonGrp -e -select 3 nurbsCylinderUseTolerance; } else { radioButtonGrp -e -select 2 nurbsCylinderUseTolerance; } } else { radioButtonGrp -e -select 1 nurbsCylinderUseTolerance; } floatSliderGrp -e -v `optionVar -q nurbsCylinderTolerance` nurbsCylinderTolerance; // Sections // intSliderGrp -e -v `optionVar -q nurbsCylinderSections` nurbsCylinderSections; // Spans // intSliderGrp -e -v `optionVar -q nurbsCylinderSpans` nurbsCylinderSpans; radioButtonGrp -e -select (`optionVar -q nurbsCylinderCaps`+1) nurbsCylinderCaps; // Disable or enable some controls depending on other values. // if ($pivotType == 2) floatFieldGrp -e -enable 1 nurbsCylinderPivot; else floatFieldGrp -e -enable 0 nurbsCylinderPivot; if ($axisType == 4) floatFieldGrp -e -enable 1 nurbsCylinderAxis; else floatFieldGrp -e -enable 0 nurbsCylinderAxis; if ($useTolerance) { if( $useGlobalTol ) { tabLayout -e -vis false tabLayoutForTolerance; } else { tabLayout -e -vis true -selectTab tabWithTolerance tabLayoutForTolerance; } } else { tabLayout -e -vis true -selectTab tabWithoutTolerance tabLayoutForTolerance; } } // // Procedure Name: // nurbsCylinderCallback // // 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 nurbsCylinderCallback(string $parent, int $doIt) { setParent $parent; // Set the optionVar's from the control values, and then // perform the command. // Pivot // int $pivotType = `radioButtonGrp -q -select nurbsCylinderPivotType`; optionVar -intValue nurbsCylinderPivotType $pivotType; if ($pivotType == 2) { optionVar -floatValue nurbsCylinderPivotX `floatFieldGrp -q -v1 nurbsCylinderPivot`; optionVar -floatValue nurbsCylinderPivotY `floatFieldGrp -q -v2 nurbsCylinderPivot`; optionVar -floatValue nurbsCylinderPivotZ `floatFieldGrp -q -v3 nurbsCylinderPivot`; } // Axis // int $axisType = `radioButtonGrp -q -select nurbsCylinderAxisType1`; if( 0 == $axisType ) { $axisType = `radioButtonGrp -q -select nurbsCylinderAxisType2` + 3; } optionVar -intValue nurbsCylinderAxisType $axisType; if( ($axisType == 4) || ($axisType == 5) ) { optionVar -floatValue nurbsCylinderAxisX `floatFieldGrp -q -v1 nurbsCylinderAxis`; optionVar -floatValue nurbsCylinderAxisY `floatFieldGrp -q -v2 nurbsCylinderAxis`; optionVar -floatValue nurbsCylinderAxisZ `floatFieldGrp -q -v3 nurbsCylinderAxis`; } // Sweep Angle (Start and End) // optionVar -floatValue nurbsCylinderStartSweep `floatSliderGrp -q -v nurbsCylinderStartSweep`; optionVar -floatValue nurbsCylinderEndSweep `floatSliderGrp -q -v nurbsCylinderEndSweep`; // Radius // float $radius = `floatSliderGrp -q -v nurbsCylinderRadius`; optionVar -floatValue nurbsCylinderRadius $radius; // Height Ratio // float $height = `floatSliderGrp -q -v nurbsCylinderHeight`; optionVar -floatValue nurbsCylinderHeightRatio `nurbsRatioConvert $radius $height true`; // Degree // int $degreeBtn = `radioButtonGrp -q -select nurbsCylinderDegree`; int $degree; switch($degreeBtn) { case 1: $degree = 1; break; case 2: $degree = 3; break; } optionVar -intValue nurbsCylinderDegree $degree; optionVar -iv nurbsCylinderGroupCaps `checkBoxGrp -q -v1 nurbsCylinderGroupCapsWidget`; // Tolerance // int $useTolerance = `radioButtonGrp -q -select nurbsCylinderUseTolerance`; switch( $useTolerance ) { case 1: optionVar -intValue nurbsCylinderUseTolerance false; break; case 2: optionVar -intValue nurbsCylinderUseTolerance true; optionVar -intValue nurbsCylinderUseGlobalTolerance false; break; case 3: default: optionVar -intValue nurbsCylinderUseTolerance true; optionVar -intValue nurbsCylinderUseGlobalTolerance true; break; } optionVar -floatValue nurbsCylinderTolerance `floatSliderGrp -q -v nurbsCylinderTolerance`; // Sections // optionVar -intValue nurbsCylinderSections `intSliderGrp -q -v nurbsCylinderSections`; // Spans // optionVar -intValue nurbsCylinderSpans `intSliderGrp -q -v nurbsCylinderSpans`; // Caps // optionVar -intValue nurbsCylinderCaps ( `radioButtonGrp -q -select nurbsCylinderCaps` - 1 ); if ($doIt) { performNurbsCylinder 0; addToRecentCommandQueue "performNurbsCylinder 0" "NURBS Cylinder"; } } // // Procedure Name: // nurbsCylinderOptions // // Description: // Construct the option box UI. Involves accessing the standard option // box and customizing the UI accordingly. // // Input Arguments: // None. // // Return Value: // None. // proc nurbsCylinderOptions() { // Name of the command for this option box. // string $commandName = "nurbsCylinder"; // Build the option box actions. // string $callback = ($commandName + "Callback"); string $setup = ($commandName + "Setup"); // STEP 1: Get the option box. // ============================ // // The value returned is the name of the layout to be used as // the parent for the option box UI. // string $layout = getOptionBox(); setParent $layout; // STEP 2: Pass the command name to the option box. // ================================================= // // Any default option box behaviour based on the command name is set // up with this call. For example, updating the 'Help' menu item with // the name of the command. // setOptionBoxCommandName("cylinder"); // STEP 3: Activate the default UI template. // ========================================== // // Activate the default UI template so that the layout of this // option box is consistent with the layout of the rest of the // application. // setUITemplate -pushTemplate DefaultTemplate; // Turn on the wait cursor. // waitCursor -state 1; // STEP 4: Create option box contents. // =================================== // tabLayout -scr true -tv false; string $parent = `columnLayout -adjustableColumn 1`; radioButtonGrp -label (uiRes("m_performNurbsCylinder.kPivot")) -numberOfRadioButtons 2 -label1 (uiRes("m_performNurbsCylinder.kObject")) -label2 (uiRes("m_performNurbsCylinder.kUserDefined")) -select 1 nurbsCylinderPivotType; floatFieldGrp -label (uiRes("m_performNurbsCylinder.kPivotPoint")) -numberOfFields 3 nurbsCylinderPivot; string $axis = (uiRes("m_performNurbsCylinder.kAxis")); radioButtonGrp -label $axis -numberOfRadioButtons 3 -label1 (uiRes("m_performNurbsCylinder.kX")) -label2 (uiRes("m_performNurbsCylinder.kY")) -label3 (uiRes("m_performNurbsCylinder.kZ")) -select 1 nurbsCylinderAxisType1; radioButtonGrp -label $axis -numberOfRadioButtons 2 -label1 (uiRes("m_performNurbsCylinder.kFree")) -label2 (uiRes("m_performNurbsCylinder.kActiveView")) -scl "nurbsCylinderAxisType1" nurbsCylinderAxisType2; floatFieldGrp -label (uiRes("m_performNurbsCylinder.kAxisDefinition")) -numberOfFields 3 nurbsCylinderAxis; separator; floatSliderGrp -label (uiRes("m_performNurbsCylinder.kStartSweepAngle")) -min 0 -max 360 -fmn -3600 -fmx 3600 nurbsCylinderStartSweep; floatSliderGrp -label (uiRes("m_performNurbsCylinder.kEndSweepAngle")) -min 0 -max 360 -fmn -3600 -fmx 3600 nurbsCylinderEndSweep; floatSliderGrp -label (uiRes("m_performNurbsCylinder.kRadius")) -min 0.0001 -max 100 -fmn 0.0001 -fmx 1000.0 nurbsCylinderRadius; floatSliderGrp -label (uiRes("m_performNurbsCylinder.kHeight")) -min 0 -max 100 -fmn 0 -fmx 1000.0 nurbsCylinderHeight; radioButtonGrp -label (uiRes("m_performNurbsCylinder.kSurfaceDegree")) -numberOfRadioButtons 2 -label1 (uiRes("m_performNurbsCylinder.kLinear")) -label2 (uiRes("m_performNurbsCylinder.kCubic")) -select 2 nurbsCylinderDegree; string $none = (uiRes("m_performNurbsCylinder.kNone")); radioButtonGrp -label (uiRes("m_performNurbsCylinder.kCaps")) -numberOfRadioButtons 4 -label1 $none -label2 (uiRes("m_performNurbsCylinder.kBottom")) -label3 (uiRes("m_performNurbsCylinder.kTop")) -label4 (uiRes("m_performNurbsCylinder.kBoth")) nurbsCylinderCaps; checkBoxGrp -label "" -ncb 1 -label1 (uiRes("m_performNurbsCylinder.kExtraTransformOnCaps")) nurbsCylinderGroupCapsWidget; // "Tolerance" disappears when "Use Tolerance" is false. // "Sections" disappears when "Use Tolerance" is true. // Note that the "-rational" flag no longer exists for // the cylinder command. We do things as if the "-rational" // flag were always false. radioButtonGrp -nrb 3 -label (uiRes("m_performNurbsCylinder.kUseTolerance")) -label1 $none -label2 (uiRes("m_performNurbsCylinder.kLocal")) -label3 (uiRes("m_performNurbsCylinder.kGlobal")) nurbsCylinderUseTolerance; tabLayout -tabsVisible false tabLayoutForTolerance; columnLayout tabWithoutTolerance; intSliderGrp -label (uiRes("m_performNurbsCylinder.kNumberOfSections")) -field true -min 4 -max 50 -fmx 200 nurbsCylinderSections; intSliderGrp -label (uiRes("m_performNurbsCylinder.kNumberOfSpans")) -field true -min 1 -max 50 -fmx 200 nurbsCylinderSpans; setParent ..; columnLayout tabWithTolerance; floatSliderGrp -label (uiRes("m_performNurbsCylinder.kPositionalTolerance")) -min 0.001 -max 1 -fmx 100.0 nurbsCylinderTolerance; setParent ..; setParent ..; // Set the pivot float fields to only be enabled when "Pivot" is "User Defined" // string $pivotEnable = ("floatFieldGrp -e -en 1 nurbsCylinderPivot;" + "floatFieldGrp -e" + " -v1 `optionVar -q nurbsCylinderPivotX`" + " -v2 `optionVar -q nurbsCylinderPivotY`" + " -v3 `optionVar -q nurbsCylinderPivotZ`" + " nurbsCylinderPivot;" ); string $pivotDisable = "floatFieldGrp -e -en 0 nurbsCylinderPivot;"; radioButtonGrp -edit -cc1 ($pivotDisable + "floatFieldGrp -e -value 0.0 0.0 0.0 0.0 nurbsCylinderPivot;") -cc2 $pivotEnable nurbsCylinderPivotType; // Set the axis float fields to only be enabled when "Axis Preset" is "Free" // string $axisEnable = ("floatFieldGrp -e -en 1 nurbsCylinderAxis;" + "floatFieldGrp -e" + " -v1 `optionVar -q nurbsCylinderAxisX`" + " -v2 `optionVar -q nurbsCylinderAxisY`" + " -v3 `optionVar -q nurbsCylinderAxisZ`" + " nurbsCylinderAxis;" ); string $axisDisable = "floatFieldGrp -e -en 0 nurbsCylinderAxis;"; radioButtonGrp -edit -cc1 ($axisDisable + "floatFieldGrp -e -value 1.0 0.0 0.0 0.0 nurbsCylinderAxis;") -cc2 ($axisDisable + "floatFieldGrp -e -value 0.0 1.0 0.0 0.0 nurbsCylinderAxis;") -cc3 ($axisDisable + "floatFieldGrp -e -value 0.0 0.0 1.0 0.0 nurbsCylinderAxis;") nurbsCylinderAxisType1; radioButtonGrp -edit -cc1 $axisEnable -cc2 $axisDisable nurbsCylinderAxisType2; // Set the "Use Tolerance" checkbox so that if the checkbox is on, // then the tolerance slider is visible. // radioButtonGrp -edit -on1 "tabLayout -e -vis true -selectTab tabWithoutTolerance tabLayoutForTolerance" -on2 "tabLayout -e -vis true -selectTab tabWithTolerance tabLayoutForTolerance" -on3 "tabLayout -e -vis false tabLayoutForTolerance" nurbsCylinderUseTolerance; // Turn off the wait cursor. // waitCursor -state 0; // Step 5: Deactivate the default UI template. // =========================================== // setUITemplate -popTemplate; // Step 6: Customize the buttons. // ============================== // // Provide more descriptive labels for the buttons. // Disable those buttons that are not applicable to the option box. // Attach actions to those buttons that are applicable to the option box. // 'Apply' button. // string $applyBtn = getOptionBoxApplyBtn(); button -edit -label (uiRes("m_performNurbsCylinder.kCreate")) -command ($callback + " " + $parent + " " + 1) $applyBtn; // 'Save' button. // string $saveBtn = getOptionBoxSaveBtn(); button -edit -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox") $saveBtn; // 'Reset' button. // string $resetBtn = getOptionBoxResetBtn(); button -edit -command ($setup + " " + $parent + " " + 1) $resetBtn; // Step 7: Set the option box title. // ================================= // setOptionBoxTitle (uiRes("m_performNurbsCylinder.kNURBSCylinderOptions")); // Step 8: Customize the 'Help' menu item text. // ============================================ // setOptionBoxHelpTag( "NurbsCylinder" ); // Set the current values of the option box. // ========================================= // eval (($setup + " " + $parent + " " + 0)); // Show the option box. // ==================== // showOptionBox(); } // // Procedure Name: // nurbsCylinderHelp // // Description: // Return a short description about this command. // // Input Arguments: // None. // // Return Value: // string. // proc string nurbsCylinderHelp() { return " Command: cylinder - create a NURBS cylinder.\n"; } // // Procedure Name: // assembleCmd // // Description: // Construct the command that will apply the option box values. // // Input Arguments: // None. // proc string assembleCmd() { string $cmd = "cylinder"; setOptionVars(false); int $pivotType = `optionVar -q nurbsCylinderPivotType`; float $pivotX = `optionVar -q nurbsCylinderPivotX`; float $pivotY = `optionVar -q nurbsCylinderPivotY`; float $pivotZ = `optionVar -q nurbsCylinderPivotZ`; if ($pivotType == 1) { $pivotX = 0; $pivotY = 0; $pivotZ = 0; } // Axis // int $axisType = `optionVar -q nurbsCylinderAxisType`; float $axis[3]; switch($axisType) { case 1: $axis[0] = 1; $axis[1] = 0; $axis[2] = 0; break; case 2: $axis[0] = 0; $axis[1] = 1; $axis[2] = 0; break; case 3: $axis[0] = 0; $axis[1] = 0; $axis[2] = 1; break; case 4: $axis[0] = `optionVar -q nurbsCylinderAxisX`; $axis[1] = `optionVar -q nurbsCylinderAxisY`; $axis[2] = `optionVar -q nurbsCylinderAxisZ`; break; case 5: $axis = `nurbsViewDirectionVector 1`; break; } // History // int $doHistory = `constructionHistory -q -toggle`; float $tol = `optionVar -query nurbsCylinderTolerance`; if( `optionVar - q nurbsCylinderUseGlobalTolerance` ) { $tol = `optionVar -q positionalTolerance`; } $cmd = ($cmd + " -p " + $pivotX + " " + $pivotY + " " + $pivotZ + " -ax " + $axis[0] + " " + $axis[1] + " " + $axis[2] + " -ssw " + `optionVar -query nurbsCylinderStartSweep` + " -esw " + `optionVar -query nurbsCylinderEndSweep` + " -r " + `optionVar -query nurbsCylinderRadius` + " -hr " + `optionVar -query nurbsCylinderHeightRatio` + " -d " + `optionVar -query nurbsCylinderDegree` + " -ut " + `optionVar -query nurbsCylinderUseTolerance` + " -tol " + $tol + " -s " + `optionVar -query nurbsCylinderSections` + " -nsp " + `optionVar -query nurbsCylinderSpans` ); int $groupCaps = `optionVar -q nurbsCylinderGroupCaps`; int $caps = `optionVar -query nurbsCylinderCaps`; if( $caps ) { $cmd = $cmd + " -ch 1; nurbsPrimitiveCap " + $caps + " " + $doHistory + " " + $groupCaps; } else { $cmd = ($cmd + " -ch " + $doHistory ); } $cmd = $cmd + "; objectMoveCommand;"; if(`optionVar -q createNurbsPrimitiveAsTool`) { $cmd = "setToolTo \"CreateNurbsCylinderCtx\""; } return $cmd; } // // Procedure Name: // performNurbsCylinder // // Description: // Perform the cylinder command using the corresponding // option values. This procedure will also show the option box // window if necessary as well as construct the command string // that will invoke the cylinder command with the current // option box values. // // Input Arguments: // 0 - Execute the command. // 1 - Show the option box dialog. // 2 - Return the command. // // Return Value: // None. // global proc string performNurbsCylinder(int $action) { string $cmd = ""; switch ($action) { // Execute the command. // case 0: // Get the command. // $cmd = `assembleCmd`; // Execute the command with the option settings. // evalEcho($cmd); break; // Show the option box. // case 1: if(`optionVar -q createNurbsPrimitiveAsTool`) { $cmd = `assembleCmd`; evalEcho($cmd); toolPropertyWindow; } else { nurbsCylinderOptions; } break; // Return the command string. // case 2: // Get the command. // $cmd = `assembleCmd`; break; } return $cmd; }