// =========================================================================== // 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: 2 June 1999 // // Procedure Name: // performPolyRotateUVsAboutVertex // // Description: // Rotates UVs about a vertex. // // Input Arguments: // $option : Whether to set the options to default values. // Return Value: // command string iff $option==2 // proc setOptionVars (int $forceFactorySettings) { if ($forceFactorySettings || !`optionVar -exists polyRotateUVAngle`) { optionVar -floatValue polyRotateUVAngle 0; } } global proc performPolyRotateUVsAboutVertexSetup (string $parent, int $forceFactorySettings) { setOptionVars($forceFactorySettings); setParent $parent; float $ang = `optionVar -q polyRotateUVAngle`; floatSliderGrp -edit -value $ang polyRotateUVAngle; } global proc performPolyRotateUVsAboutVertexCallback (string $parent, int $doIt) { setParent $parent; float $ang = `floatSliderGrp -query -value polyRotateUVAngle`; optionVar -floatValue polyRotateUVAngle $ang; if ($doIt) { performPolyRotateUVsAboutVertex 0; addToRecentCommandQueue "performPolyRotateUVsAboutVertex 0" "PolyRotateUVsAboutVertex"; } } proc polyRotateUVsOptions () { string $layout = getOptionBox(); setParent $layout; setUITemplate -pushTemplate DefaultTemplate; waitCursor -state 1; tabLayout -scr true -tv false; string $parent = `columnLayout -adjustableColumn 1`; string $commandName = "performPolyRotateUVsAboutVertex"; string $callback = ($commandName + "Callback " + $parent + " "); string $setup = ($commandName + "Setup " + $parent + " "); setOptionBoxCommandName($commandName); floatSliderGrp -label (uiRes("m_performPolyRotateUVsAboutVertex.kRotationAngle")) -min 0.0 -max 360.0 polyRotateUVAngle; waitCursor -state 0; setUITemplate -popTemplate; string $applyBtn = getOptionBoxApplyBtn(); button -edit -label (uiRes("m_performPolyRotateUVsAboutVertex.kRotate")) -command ($callback + 1) $applyBtn; string $saveBtn = getOptionBoxSaveBtn(); button -edit -command ($callback + 0 + "; hideOptionBox") $saveBtn; string $resetBtn = getOptionBoxResetBtn(); button -edit -command ($setup + 1) $resetBtn; setOptionBoxTitle( (uiRes("m_performPolyRotateUVsAboutVertex.kOptionBoxTitle")) ); setOptionBoxHelpTag( "" ); eval (($setup + 0)); showOptionBox(); } proc string assembleCmd() { int $doHistory = `constructionHistory -q -toggle`; string $cmd=("polyRotateUVsAboutVertex "); float $ang = `optionVar -q polyRotateUVAngle`; $cmd += $ang; return $cmd; } global proc string performPolyRotateUVsAboutVertex (int $option) { string $cmd=""; switch ($option) { case 0: $cmd=`assembleCmd `; string $res=`evalEcho $cmd`; break; case 1: polyRotateUVsOptions; break; case 2: $cmd=`assembleCmd`; break; default: $cmd = ("performPolyRotateUVsAboutVertex 0"); } return $cmd; }