// =========================================================================== // 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: // performSubdMapSewMove // // Description: // // // Input Arguments: // $option : Whether to set the options to default values. // Return Value: // command string iff $option==2 // // // Initialize optionVars for subdMapSewMove: // Color, Texture, Vertex // proc setOptionVars ( string $prefix, int $forceFactorySettings, string $vars[] ) { string $varName; // Must match $vars int $intValues[]= { 0, 10 }; for ( $i = size($vars) ; $i-- ; ) { $varName = ($prefix + $vars[$i]); if ($forceFactorySettings || !`optionVar -exists $varName`) optionVar -intValue $varName $intValues[$i]; } } global proc performSubdMapSewMoveSetup (string $parent, int $forceFactorySettings) { string $prefix = "subdMapSewMove"; string $intVars[] ={"lps", "nf"}; string $varName; setOptionVars($prefix, $forceFactorySettings, $intVars); setParent $parent; $varName = ($prefix + $intVars[0]); int $val = `optionVar -query $varName`; checkBoxGrp -edit -value1 $val $varName; $varName = ($prefix + $intVars[1]); intSliderGrp -edit -en $val -value `optionVar -query $varName` $varName; } global proc performSubdMapSewMoveCallback (string $parent, int $doIt) { string $prefix = "subdMapSewMove"; string $intVars[] ={"lps", "nf"}; string $varName; setParent $parent; $varName = ($prefix + $intVars[0]); optionVar -intValue $varName `checkBoxGrp -query -value1 $varName`; $varName = ($prefix + $intVars[1]); optionVar -intValue $varName (`intSliderGrp -q -value $varName`); if ($doIt) { performSubdMapSewMove 0; addToRecentCommandQueue "performSubdMapSewMove 0" "SubdMapSewMove"; } } proc subdMapSewMoveOptions (string $prefix, string $intVars[]) { string $commandName = "performSubdMapSewMove"; string $callback = ($commandName + "Callback"); string $setup = ($commandName + "Setup"); string $varName; string $layout = getOptionBox(); setParent $layout; setUITemplate -pushTemplate DefaultTemplate; waitCursor -state 1; string $parent = `columnLayout -adjustableColumn 1`; $varName = ($prefix + $intVars[0]); $varName2 = ($prefix + $intVars[1]); string $grayCmd = "{ int $tmp = `checkBoxGrp -q -v1 "+$varName + "`;" + " intSliderGrp -e -en $tmp "+$varName2+";}"; checkBoxGrp -label1 (uiRes("m_performSubdMapSewMove.kLimitPieceSize")) -cc $grayCmd $varName; intSliderGrp -label (uiRes("m_performSubdMapSewMove.kNumberOfFaces")) $varName2; waitCursor -state 0; setUITemplate -popTemplate; string $applyBtn = getOptionBoxApplyBtn(); button -edit -label (uiRes("m_performSubdMapSewMove.kMoveAndSew")) -command ($callback + " " + $parent + " " + 1) $applyBtn; string $saveBtn = getOptionBoxSaveBtn(); button -edit -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox") $saveBtn; string $resetBtn = getOptionBoxResetBtn(); button -edit -command ($setup + " " + $parent + " " + 1) $resetBtn; setOptionBoxTitle (uiRes("m_performSubdMapSewMove.kSubdivMoveAndSewUVsOptions")); setOptionBoxHelpTag( "SubdivMoveandSewUVs" ); eval (($setup + " " + $parent + " " + 0)); showOptionBox(); } global proc string performSubdMapSewMove (int $option) { string $prefix = "subdMapSewMove"; string $intVars[] ={"lps", "nf"}; string $cmd=""; switch ($option) { case 0: string $varName; int $ival; setOptionVars($prefix, false, $intVars); $cmd = "subdMapSewMove"; for ( $i = size($intVars) ; $i-- ; ) { $varName = ($prefix + $intVars[$i]); $ival = `optionVar -query $varName`; $cmd = $cmd + " -" + $intVars[$i] + " " + $ival; } evalEcho $cmd; break; case 1: subdMapSewMoveOptions($prefix, $intVars); break; case 2: $cmd="performSubdMapSewMove 0"; break; } return $cmd; }