// =========================================================================== // 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: 7 February 2001 // // Description: // // // // 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 tessellationSetupSurfaces`) { optionVar -intValue tessellationSetupSurfaces 0; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupType`) { optionVar -intValue tessellationSetupType 0; } // Optimize if ($forceFactorySettings || !`optionVar -exists tessellationSetupFrame`) { optionVar -intValue tessellationSetupFrame 0; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupCamera`) { optionVar -intValue tessellationSetupCamera 0; } // Basic if ($forceFactorySettings || !`optionVar -exists tessellationSetupCurvature`) { optionVar -intValue tessellationSetupCurvature 2; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupDivisionU`) { optionVar -floatValue tessellationSetupDivisionU 1.5; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupDivisionV`) { optionVar -floatValue tessellationSetupDivisionV 1.5; } // Primary (Advanced) if ($forceFactorySettings || !`optionVar -exists tessellationSetupModeU`) { optionVar -intValue tessellationSetupModeU 2; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupNumberU`) { optionVar -intValue tessellationSetupNumberU 3; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupModeV`) { optionVar -intValue tessellationSetupModeV 2; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupNumberV`) { optionVar -intValue tessellationSetupNumberV 3; } // Secondary (Advanced) if ($forceFactorySettings || !`optionVar -exists tessellationSetupUseChordHeight`) { optionVar -intValue tessellationSetupUseChordHeight false; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupChordHeight`) { optionVar -floatValue tessellationSetupChordHeight 0.010; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupUseChordHeightRatio`) { optionVar -intValue tessellationSetupUseChordHeightRatio true; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupChordHeightRatio`) { optionVar -floatValue tessellationSetupChordHeightRatio 0.99; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupUseMinScreen`) { optionVar -intValue tessellationSetupUseMinScreen false; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupMinScreen`) { optionVar -floatValue tessellationSetupMinScreen 14.0; } // Options if ($forceFactorySettings || !`optionVar -exists tessellationSetupUseSmoothEdge`) { optionVar -intValue tessellationSetupUseSmoothEdge false; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupSmoothEdge`) { optionVar -floatValue tessellationSetupSmoothEdge 0.99; } if ($forceFactorySettings || !`optionVar -exists tessellationSetupEdgeSwap`) { optionVar -intValue tessellationSetupEdgeSwap false; } } // // Procedure Name: // tessellationSetupSetup // // 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 tessellationSetupSetup(string $parent, int $forceFactorySettings) { // Retrieve the option settings // setOptionVars($forceFactorySettings); setParent $parent; // Query the optionVar's and set the values into the controls. int $surfacesOption = `optionVar -query tessellationSetupSurfaces`; if ($surfacesOption == 0) radioButtonGrp -e -select 1 selectedSurfacesRadio; else if ($surfacesOption == 1) radioButtonGrp -e -select 1 allSurfacesRadio; int $typeOption = `optionVar -query tessellationSetupType`; if ($typeOption == 0) { radioButtonGrp -e -select 1 automaticTessellationRadio; radioButtonGrp -e -select 1 basicTessellationRadio; tessellationSetupCB("automatic"); } else if ($typeOption == 1) { radioButtonGrp -e -select 1 manualTessellationRadio; radioButtonGrp -e -select 1 basicTessellationRadio; tessellationSetupCB("basic"); } else if ($typeOption == 2) { radioButtonGrp -e -select 1 manualTessellationRadio; radioButtonGrp -e -select 1 advancedTessellationRadio; tessellationSetupCB("advanced"); } // Optimize int $frameOption = `optionVar -query tessellationSetupFrame`; if ($frameOption == 0) radioButtonGrp -e -select 1 renderGlobalsRadio; else if ($frameOption == 1) radioButtonGrp -e -select 1 timeSliderRadio; else if ($frameOption == 2) radioButtonGrp -e -select 1 currentFrameRadio; int $cameraOption = `optionVar -query tessellationSetupCamera`; if ($cameraOption == 0) radioButtonGrp -e -select 1 allCamerasRadio; else if ($cameraOption == 1) radioButtonGrp -e -select 1 activeCameraRadio; // Basic int $curvatureOption = `optionVar -query tessellationSetupCurvature`; optionMenuGrp -e -select ($curvatureOption+1) curvatureMenu; float $uDivisionOption = `optionVar -query tessellationSetupDivisionU`; floatSliderGrp -e -value $uDivisionOption uFactorSlider; float $vDivisionOption = `optionVar -query tessellationSetupDivisionV`; floatSliderGrp -e -value $vDivisionOption vFactorSlider; // Primary (Advanced) int $uModeOption = `optionVar -query tessellationSetupModeU`; optionMenuGrp -e -select ($uModeOption+1) uModeMenu; int $uNumberOption = `optionVar -query tessellationSetupNumberU`; intSliderGrp -e -value $uNumberOption uNumberSlider; int $vModeOption = `optionVar -query tessellationSetupModeV`; optionMenuGrp -e -select ($vModeOption+1) vModeMenu; int $vNumberOption = `optionVar -query tessellationSetupNumberV`; intSliderGrp -e -value $vNumberOption vNumberSlider; // Secondary (Advanced) int $useChordHeightOption = `optionVar -query tessellationSetupUseChordHeight`; checkBoxGrp -e -value1 $useChordHeightOption chordHeightBox; float $chordHeightOption = `optionVar -query tessellationSetupChordHeight`; floatSliderGrp -e -value $chordHeightOption chordHeightSlider; tessellationSetupCB("chordHeight"); int $useChordHeightRatioOption = `optionVar -query tessellationSetupUseChordHeightRatio`; checkBoxGrp -e -value1 $useChordHeightRatioOption chordHeightRatioBox; float $chordHeightRatioOption = `optionVar -query tessellationSetupChordHeightRatio`; floatSliderGrp -e -value $chordHeightRatioOption chordHeightRatioSlider; tessellationSetupCB("chordHeightRatio"); int $useMinScreenOption = `optionVar -query tessellationSetupUseMinScreen`; checkBoxGrp -e -value1 $useMinScreenOption minScreenBox; float $minScreenOption = `optionVar -query tessellationSetupMinScreen`; floatFieldGrp -e -value1 $minScreenOption minScreenField; tessellationSetupCB("minScreen"); // Options int $useSmoothEdgeOption = `optionVar -query tessellationSetupUseSmoothEdge`; checkBoxGrp -e -value1 $useSmoothEdgeOption smoothEdgeBox; float $smoothEdgeOption = `optionVar -query tessellationSetupSmoothEdge`; floatSliderGrp -e -value $smoothEdgeOption smoothEdgeSlider; tessellationSetupCB("smoothEdge"); int $edgeSwapOption = `optionVar -query tessellationSetupEdgeSwap`; checkBoxGrp -e -value1 $edgeSwapOption edgeSwapBox; } // // Procedure Name: // runupTessellationCallback // // 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 tessellationSetupCallback(string $parent, int $doIt) { setParent $parent; // Set the optionVar's from the control values, and then // perform the command. int $surfacesOption; if (`radioButtonGrp -q -select selectedSurfacesRadio`) $surfacesOption = 0; else if (`radioButtonGrp -q -select allSurfacesRadio`) $surfacesOption = 1; optionVar -intValue tessellationSetupSurfaces $surfacesOption; int $typeOption; if (`radioButtonGrp -q -select automaticTessellationRadio`) $typeOption = 0; else if (`radioButtonGrp -q -select basicTessellationRadio`) $typeOption = 1; else if (`radioButtonGrp -q -select advancedTessellationRadio`) $typeOption = 2; optionVar -intValue tessellationSetupType $typeOption; // Optimize int $frameOption; if (`radioButtonGrp -q -select renderGlobalsRadio`) $frameOption = 0; else if (`radioButtonGrp -q -select timeSliderRadio`) $frameOption = 1; else if (`radioButtonGrp -q -select currentFrameRadio`) $frameOption = 2; optionVar -intValue tessellationSetupFrame $frameOption; int $cameraOption; if (`radioButtonGrp -q -select allCamerasRadio`) $cameraOption = 0; else if (`radioButtonGrp -q -select activeCameraRadio`) $cameraOption = 1; optionVar -intValue tessellationSetupCamera $cameraOption; // Basic int $curvatureOption = (`optionMenuGrp -q -select curvatureMenu` - 1); optionVar -intValue tessellationSetupCurvature $curvatureOption; float $uFactorOption = `floatSliderGrp -q -value uFactorSlider`; optionVar -floatValue tessellationSetupDivisionU $uFactorOption; float $vFactorOption = `floatSliderGrp -q -value vFactorSlider`; optionVar -floatValue tessellationSetupDivisionV $vFactorOption; // Primary (Advanced) int $uModeOption = (`optionMenuGrp -q -select uModeMenu` - 1); optionVar -intValue tessellationSetupModeU $uModeOption; int $uNumberOption = `intSliderGrp -q -value uNumberSlider`; optionVar -intValue tessellationSetupNumberU $uNumberOption; int $vModeOption = (`optionMenuGrp -q -select vModeMenu` - 1); optionVar -intValue tessellationSetupModeV $vModeOption; int $vNumberOption = `intSliderGrp -q -value vNumberSlider`; optionVar -intValue tessellationSetupNumberV $vNumberOption; // Secondary (Advanced) int $useChordHeightOption = `checkBoxGrp -q -value1 chordHeightBox`; optionVar -intValue tessellationSetupUseChordHeight $useChordHeightOption; float $chordHeightOption = `floatSliderGrp -q -value chordHeightSlider`; optionVar -floatValue tessellationSetupChordHeight $chordHeightOption; int $useChordHeightRatioOption = `checkBoxGrp -q -value1 chordHeightRatioBox`; optionVar -intValue tessellationSetupUseChordHeightRatio $useChordHeightRatioOption; float $chordHeightRatioOption = `floatSliderGrp -q -value chordHeightRatioSlider`; optionVar -floatValue tessellationSetupChordHeightRatio $chordHeightRatioOption; int $useMinScreenOption = `checkBoxGrp -q -value1 minScreenBox`; optionVar -intValue tessellationSetupUseMinScreen$useMinScreenOption; float $minScreenOption = `floatFieldGrp -q -value1 minScreenField`; optionVar -floatValue tessellationSetupMinScreen $minScreenOption; // Options int $useSmoothEdgeOption = `checkBoxGrp -q -value1 smoothEdgeBox`; optionVar -intValue tessellationSetupUseSmoothEdge $useSmoothEdgeOption; float $smoothEdgeOption = `floatSliderGrp -q -value smoothEdgeSlider`; optionVar -floatValue tessellationSetupSmoothEdge $smoothEdgeOption; int $edgeSwapOption = `checkBoxGrp -q -value1 edgeSwapBox`; optionVar -intValue tessellationSetupEdgeSwap $edgeSwapOption; if ($doIt) { performTessellationSetup 0; } } global proc tessellationSetupCB( string $value ) { if ($value == "automatic") { frameLayout -e -collapse false automaticFrame; frameLayout -e -collapse true manualFrame; frameLayout -e -collapse false basicFrame; frameLayout -e -collapse true primaryFrame; frameLayout -e -collapse true secondaryFrame; frameLayout -e -collapse false optionsFrame; } else if ($value == "manual") { if (`radioButtonGrp -q -select basicTessellationRadio`) { tessellationSetupCB("basic"); } else if (`radioButtonGrp -q -select advancedTessellationRadio`) { tessellationSetupCB("advanced"); } } else if ($value == "basic") { frameLayout -e -collapse true automaticFrame; frameLayout -e -collapse false manualFrame; frameLayout -e -collapse false basicFrame; frameLayout -e -collapse true primaryFrame; frameLayout -e -collapse true secondaryFrame; frameLayout -e -collapse false optionsFrame; } else if ($value == "advanced") { frameLayout -e -collapse true automaticFrame; frameLayout -e -collapse false manualFrame; frameLayout -e -collapse true basicFrame; frameLayout -e -collapse false primaryFrame; frameLayout -e -collapse false secondaryFrame; frameLayout -e -collapse false optionsFrame; } else if ($value == "chordHeight") { int $value = `checkBoxGrp -q -value1 chordHeightBox`; floatSliderGrp -e -enable $value chordHeightSlider; } else if ($value == "chordHeightRatio") { int $value = `checkBoxGrp -q -value1 chordHeightRatioBox`; floatSliderGrp -e -enable $value chordHeightRatioSlider; } else if ($value == "minScreen") { int $value = `checkBoxGrp -q -value1 minScreenBox`; floatFieldGrp -e -enable $value minScreenField; } else if ($value == "smoothEdge") { int $value = `checkBoxGrp -q -value1 smoothEdgeBox`; floatSliderGrp -e -enable $value smoothEdgeSlider; } } // // Procedure Name: // tessellationSetupOptions // // Description: // Construct the option box UI. Involves accessing the standard option // box and customizing the UI accordingly. // // Input Arguments: // None. // // Return Value: // None. // proc tessellationSetupOptions() { // Name of the command for this option box. // string $commandName = "tessellationSetup"; // 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($commandName); // 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; // STEP 4: Create option box contents. // =================================== // // This, of course, will vary from option box to option box. // Turn on the wait cursor. // waitCursor -state 1; // RECOMMENDATION: Place the UI in a 'scrollable' layout. A // scrollable layout ensures that if the option box window is ever // resized such that it's entire contents is not visible then the // scroll bars provided by the scrollable layout will allow the user // to access the hidden UI. Two layouts currently supporting // scrollable behaviour are the 'scrollLayout' and the 'tabLayout'. // scrollLayout; // // or... // // tabLayout -tabsVisible 0 -scrollable 1; string $parent = `columnLayout -adjustableColumn 1`; // RECOMMENDATION: Use the 'Grp' commands where possible because // they obey the formatting specified in the default template. // This will result in a more consistent look throughout the // application. // separator -height 10 -style "none"; radioButtonGrp -numberOfRadioButtons 1 -label (uiRes("m_performTessellationSetup.kApplyTessellation")) -label1 (uiRes("m_performTessellationSetup.kSelectedSurface")) selectedSurfacesRadio; radioButtonGrp -numberOfRadioButtons 1 -label "" -label1 (uiRes("m_performTessellationSetup.kAllSurfaces")) -shareCollection selectedSurfacesRadio allSurfacesRadio; separator -height 10 -style "none"; radioButtonGrp -numberOfRadioButtons 1 -label (uiRes("m_performTessellationSetup.kTessellationMode")) -label1 (uiRes("m_performTessellationSetup.kAutomatic")) -onCommand "tessellationSetupCB automatic" automaticTessellationRadio; radioButtonGrp -numberOfRadioButtons 1 -label "" -label1 (uiRes("m_performTessellationSetup.kManual")) -onCommand "tessellationSetupCB manual" -shareCollection automaticTessellationRadio manualTessellationRadio; frameLayout -labelVisible false -borderVisible false automaticFrame; columnLayout; separator -height 15; radioButtonGrp -numberOfRadioButtons 1 -label (uiRes("m_performTessellationSetup.kUseFrameRange")) -label1 (uiRes("m_performTessellationSetup.kRenderSettings")) renderGlobalsRadio; radioButtonGrp -numberOfRadioButtons 1 -label "" -label1 (localizedUIComponentLabel("Time Slider")) -shareCollection renderGlobalsRadio timeSliderRadio; radioButtonGrp -numberOfRadioButtons 1 -label "" -label1 (uiRes("m_performTessellationSetup.kCurrentFrame")) -shareCollection renderGlobalsRadio currentFrameRadio; separator -height 10 -style "none"; radioButtonGrp -numberOfRadioButtons 1 -label (uiRes("m_performTessellationSetup.kComputeFrom")) -label1 (uiRes("m_performTessellationSetup.kAllRenderableCamera")) allCamerasRadio; radioButtonGrp -numberOfRadioButtons 1 -label "" -label1 (uiRes("m_performTessellationSetup.kCurrentView")) -shareCollection allCamerasRadio activeCameraRadio; setParent ..; setParent ..; frameLayout -labelVisible false -borderVisible false manualFrame; columnLayout; separator -height 15; radioButtonGrp -numberOfRadioButtons 1 -label (uiRes("m_performTessellationSetup.kManualMode")) -label1 (uiRes("m_performTessellationSetup.kBasic")) -onCommand "tessellationSetupCB basic" basicTessellationRadio; radioButtonGrp -numberOfRadioButtons 1 -label "" -label1 (uiRes("m_performTessellationSetup.kAdvanced")) -onCommand "tessellationSetupCB advanced" -shareCollection basicTessellationRadio advancedTessellationRadio; setParent ..; setParent ..; frameLayout -borderVisible false -labelVisible false basicFrame; columnLayout; separator -height 15; optionMenuGrp -label (uiRes("m_performTessellationSetup.kCurvatureTolerance")) curvatureMenu; menuItem -label (uiRes("m_performTessellationSetup.kHighestQuality")); menuItem -label (uiRes("m_performTessellationSetup.kHighQuality")); menuItem -label (uiRes("m_performTessellationSetup.kMediumQuality")); menuItem -label (uiRes("m_performTessellationSetup.kLowQuality")); menuItem -label (uiRes("m_performTessellationSetup.kNoCurvatureCheck")); floatSliderGrp -label (uiRes("m_performTessellationSetup.kUDivisionFactor")) -minValue 0.1 -maxValue 5 uFactorSlider; floatSliderGrp -label (uiRes("m_performTessellationSetup.kVDivisionFactor")) -minValue 0.1 -maxValue 5 vFactorSlider; setParent ..; setParent ..; frameLayout -borderVisible false -labelVisible false primaryFrame; columnLayout; separator -height 15; optionMenuGrp -label (uiRes("m_performTessellationSetup.kModeU")) uModeMenu; menuItem -label (uiRes("m_performTessellationSetup.kPerSurfNumberOfIsoparamsIn3D")); menuItem -label (uiRes("m_performTessellationSetup.kPerSurfNumberOfIsoParams")); menuItem -label (uiRes("m_performTessellationSetup.kPerSpanNumberOfIsoparams")); menuItem -label (uiRes("m_performTessellationSetup.kBestGuessBasedOnScreenSize")); intSliderGrp -label (uiRes("m_performTessellationSetup.kNumberU")) -minValue 1 -maxValue 20 uNumberSlider; optionMenuGrp -label (uiRes("m_performTessellationSetup.kModeV")) vModeMenu; menuItem -label (uiRes("m_performTessellationSetup.kPerSurfNumberOfIsoparamsIn3D2")); menuItem -label (uiRes("m_performTessellationSetup.kPerSurfNumberOfIsoparams2")); menuItem -label (uiRes("m_performTessellationSetup.kPerSpanNumberOfIsoparams2")); menuItem -label (uiRes("m_performTessellationSetup.kBestGuess")); intSliderGrp -label (uiRes("m_performTessellationSetup.kNumberV2")) -minValue 1 -maxValue 20 vNumberSlider; setParent ..; setParent ..; frameLayout -borderVisible false -labelVisible false secondaryFrame; columnLayout; separator -height 15; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_performTessellationSetup.kUseChordHeight")) -changeCommand "tessellationSetupCB chordHeight" chordHeightBox; floatSliderGrp -label (uiRes("m_performTessellationSetup.kChordHeight")) -minValue 0.001 -maxValue 0.2 chordHeightSlider; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_performTessellationSetup.kUseChordHeightRatio")) -changeCommand "tessellationSetupCB chordHeightRatio" chordHeightRatioBox; floatSliderGrp -label (uiRes("m_performTessellationSetup.kChordHeightRatio")) -minValue 0.9 -maxValue 0.99 chordHeightRatioSlider; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_performTessellationSetup.kUseMinScreen")) -changeCommand "tessellationSetupCB minScreen" minScreenBox; floatFieldGrp -label (uiRes("m_performTessellationSetup.kMinScreen")) minScreenField; setParent ..; setParent ..; frameLayout -borderVisible false -labelVisible false optionsFrame; columnLayout; separator -height 15; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_performTessellationSetup.kUseSmoothEdge")) -changeCommand "tessellationSetupCB smoothEdge" smoothEdgeBox; floatSliderGrp -label (uiRes("m_performTessellationSetup.kSmoothEdgeRatio")) -minValue 0.95 -maxValue 0.999 -fieldMinValue 0.1 smoothEdgeSlider; checkBoxGrp -numberOfCheckBoxes 1 -label "" -label1 (uiRes("m_performTessellationSetup.kEdgeSwap")) edgeSwapBox; setParent ..; setParent ..; // 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. This is not // necessary, but in some cases, for example, a button labelled // 'Create' may be more meaningful to the user than one labelled // 'Apply'. // // Disable those buttons that are not applicable to the option box. // // Attach actions to those buttons that are applicable to the option // box. Note that the 'Close' button has a default action attached // to it that will hide the window. If a a custom action is // attached to the 'Close' button then be sure to call the 'hide the // option box' procedure within the custom action so that the option // box is hidden properly. // 'Apply' button. // string $applyBtn = getOptionBoxApplyBtn(); button -edit -command ($callback + " " + $parent + " " + 1) -label (uiRes("m_performTessellationSetup.kSet")) $applyBtn; string $applyAndCloseBtn = getOptionBoxApplyAndCloseBtn(); button -edit -label (uiRes("m_performTessellationSetup.kSetandClose")) $applyAndCloseBtn; // '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_performTessellationSetup.kSetNURBSTessellationOptions"))); // Step 8: Customize the 'Help' menu item text. // ============================================ // setOptionBoxHelpTag( "SetNURBSTessellation" ); // Step 9: Set the current values of the option box. // ================================================= // eval (($setup + " " + $parent + " " + 0)); // Step 10: Show the option box. // ============================= // showOptionBox(); } // // Procedure Name: // tessellationSetupHelp // // Description: // Return a short description about this command. // // Input Arguments: // None. // // Return Value: // string. // proc string tessellationSetupHelp() { // ******** Example // " Command: Extrude - create a surface using extrusion.\n" + // "Selection: curves and isoparms." return (uiRes("m_performTessellationSetup.kTessellationHelp")); } // // Procedure Name: // assembleCmd // // Description: // Construct the command that will apply the option box values. // // Input Arguments: // None. // proc string assembleCmd() { setOptionVars(false); int $surfacesOption = `optionVar -query tessellationSetupSurfaces`; int $typeOption = `optionVar -query tessellationSetupType`; // Optimize int $frameOption = `optionVar -query tessellationSetupFrame`; int $cameraOption = `optionVar -query tessellationSetupCamera`; // Basic int $curvatureOption = `optionVar -query tessellationSetupCurvature`; float $uDivisionOption = `optionVar -query tessellationSetupDivisionU`; float $vDivisionOption = `optionVar -query tessellationSetupDivisionV`; // Primary (Advanced) // The attribute in the NURBS shape is numbered starting at 1, // optionVar starts at 0. int $uModeOption = `optionVar -query tessellationSetupModeU`+1; int $uNumberOption = `optionVar -query tessellationSetupNumberU`; int $vModeOption = `optionVar -query tessellationSetupModeV`+1; int $vNumberOption = `optionVar -query tessellationSetupNumberV`; // Secondary (Advanced) int $useChordHeightOption = `optionVar -query tessellationSetupUseChordHeight`; float $chordHeightOption = `optionVar -query tessellationSetupChordHeight`; int $useChordHeightRatioOption = `optionVar -query tessellationSetupUseChordHeightRatio`; float $chordHeightRatioOption = `optionVar -query tessellationSetupChordHeightRatio`; int $useMinScreenOption = `optionVar -query tessellationSetupUseMinScreen`; float $minScreenOption = `optionVar -query tessellationSetupMinScreen`; // Options int $useSmoothEdgeOption = `optionVar -query tessellationSetupUseSmoothEdge`; float $smoothEdgeOption = `optionVar -query tessellationSetupSmoothEdge`; int $edgeSwapOption = `optionVar -query tessellationSetupEdgeSwap`; string $cmd = "tessellationSetup"; $cmd = ($cmd + " " + $surfacesOption + " " + $typeOption + " " + $frameOption + " " + $cameraOption + " " + $curvatureOption + " " + $uDivisionOption + " " + $vDivisionOption + " " + $uModeOption + " " + $uNumberOption + " " + $vModeOption + " " + $vNumberOption + " " + $useChordHeightOption + " " + $chordHeightOption + " " + $useChordHeightRatioOption + " " + $chordHeightRatioOption + " " + $useMinScreenOption + " " + $minScreenOption + " " + $useSmoothEdgeOption + " " + $smoothEdgeOption + " " + $edgeSwapOption ); return $cmd; } // // Procedure Name: // performTessellationSetup // // Description: // Perform the tessellationSetup 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 runupTessellation command with the current // option box values. // // Input Arguments: // 0 - Execute the command. // 1 - Show the setup tessellation dialog. // 2 - Return the command. // global proc string performTessellationSetup(int $action) { string $cmd = ""; switch ($action) { // Execute the command. // case 0: // Get the command. // $cmd = `assembleCmd`; // Execute the command with the option settings. // eval($cmd); break; // Show the option box. // case 1: tessellationSetupOptions; break; // Return the command string. // case 2: // Get the command. // $cmd = `assembleCmd`; break; } return $cmd; }