// =========================================================================== // 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: 4 April 1997 // // Procedure Name: // performSubdAutoProj // // Description: // // // Input Arguments: // $option : Whether to set the options to default values. // Return Value: // command string iff $option==2 // // // Initialize optionVars for subdLayoutUV: // Color, Texture, Vertex // proc setOptionVars ( string $prefix, int $forceFactorySettings, string $vars[] ) { string $varName; // Must match $vars int $intValues[]= { 1, 1, 2, 1, 2 }; for ( $i = size($vars) ; $i-- ; ) { $varName = ($prefix + $vars[$i]); if ($forceFactorySettings || !`optionVar -exists $varName`) optionVar -intValue $varName $intValues[$i]; } $varName = ($prefix + "eg"); if ($forceFactorySettings || !`optionVar -exists $varName`) optionVar -floatValue $varName .2; } global proc performSubdLayoutUVSetup (string $parent, int $forceFactorySettings) { global float $gShellSpacingPresets[]; string $prefix = "subdLayoutUV"; string $intVars[] = {"fr", "rbf", "se", "sc", "l", "lm"}; string $varName; int $i; setOptionVars($prefix, $forceFactorySettings, $intVars); setParent $parent; $varName = ($prefix + $intVars[0]); checkBoxGrp -e -value1 `optionVar -q $varName` $varName; for ($i=size($intVars)-1; $i>0; $i--) { $varName = ($prefix + $intVars[$i]); radioButtonGrp -e -sl (1+`optionVar -q $varName`) $varName; } $varName = ($prefix + $intVars[0]); checkBoxGrp -e -value1 `optionVar -q $varName` $varName; $varName = ($prefix + "eg"); float $fval = `optionVar -q $varName`; floatSliderGrp -e -v $fval $varName; // See if the value corresponds to one of the shell spacing presets. $varName = ($prefix + "egPresets"); optionMenuGrp -e -sl 1 $varName; for ($i = size($gShellSpacingPresets) ; $i-- ; ) { if ($fval == $gShellSpacingPresets[$i]) { optionMenuGrp -e -sl ($i+2) $varName; break; } } } global proc performSubdLayoutUVCallback (string $parent, int $doIt) { string $prefix = "subdLayoutUV"; string $intVars[] = {"fr", "rbf", "se", "sc", "l", "lm"}; string $varName; setParent $parent; for ($i=size($intVars)-1; $i>0; $i--) { $varName = ($prefix + $intVars[$i]); optionVar -intValue $varName (`radioButtonGrp -q -sl $varName`-1); } $varName = ($prefix + $intVars[0]); optionVar -intValue $varName `checkBoxGrp -q -value1 $varName`; $varName = ($prefix + "eg"); optionVar -floatValue $varName `floatSliderGrp -q -v $varName`; if ($doIt) { performSubdLayoutUV 0; addToRecentCommandQueue "performSubdLayoutUV 0" "SubdLayoutUV"; } } global proc subdLayoutSpacingPresets() { global float $gShellSpacingPresets[]; int $item = `optionMenuGrp -q -sl "subdLayoutUVegPresets"`-2; if ($item>=0 && $item= 0; $i--) { string $varName = ($prefix + $intVars[$i]); int $ival = `optionVar -query $varName`; $cmd = $cmd + " -" + $intVars[$i] + " " + $ival; } $varName = ($prefix + "eg"); float $fval = `optionVar -query $varName`; $cmd = $cmd + " -ps " + $fval; evalEcho $cmd; break; case 1: subdLayoutUVOptions($prefix, $intVars); break; case 2: $cmd="performSubdLayoutUV 0"; break; } return $cmd; }