// =========================================================================== // 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: March 17, 1997 // // Description: // This script sets the values for the specified moveKey context // within the tool property sheet. // // Input Arguments: // string $context The name of the actual context being edited // // Return Value: // None. // global proc moveKeyValues (string $context) { string $parent = `toolPropertyWindow -query -location`; setParent $parent; string $currentOption = `moveKeyCtx -query -option $context`; int $option = 1; if ($currentOption == "over") $option = 2; radioButtonGrp -edit -onCommand1 ("moveKeyCtx -edit -option move " + $context) -onCommand2 ("moveKeyCtx -edit -option over " + $context) -select $option moveKeyOption; string $currentFunction = `moveKeyCtx -query -moveFunction $context`; $option = 1; if ($currentFunction == "linear" ) $option = 2; if ($currentFunction == "power" ) $option = 3; // Set our optionMenuGrp changeCommand and select the current moveFunction // from the list. // string $optMenuCmd = "moveKeyCtxMoveFunction( \"moveKeyFunction\", \"" + $context + "\")"; optionMenuGrp -e -cc $optMenuCmd -sl $option moveKeyFunction; string $helpTag = "MoveKeyTool"; toolPropertySetCommon $context "move_M.png" $helpTag; toolPropertySelect "moveKey"; } global proc moveKeyCtxMoveFunction( string $optMenuGrp, string $context ) { int $option = 0; $option = `optionMenuGrp -q -sl $optMenuGrp`; string $strOption = "constant"; switch( $option ) { case 1: $strOption = "constant"; break; case 2: $strOption = "linear"; break; case 3: $strOption = "power"; break; }; string $cmd = "moveKeyCtx -e -moveFunction " + $strOption + " " + $context; if( catch(eval($cmd)) ) { string $output = (uiRes("m_moveKeyValues.kError")); $output = `format -s $strOption $output`; print $output; } }