// =========================================================================== // 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: Jan, 2008 // // Input Arguments: // None // // Return Value: // None. // global proc strsTweakModeSetTool(int $turnOn) { optionVar -iv trsManipsTweakMode $turnOn; manipMoveContext -edit -tweakMode $turnOn Move; manipRotateContext -edit -tweakMode $turnOn Rotate; manipScaleContext -edit -tweakMode $turnOn Scale; } global proc strsTweakModeDoIt (int $opt) { string $ctx = `currentCtx`; string $ctxClass = `contextInfo -q -class $ctx`; if ($ctxClass == "selectTool" || $ctxClass == "manipMove" || $ctxClass == "manipRotate" || $ctxClass == "manipScale" || $ctxClass == "xformManipulator") { int $switchToMoveCtx = ($ctxClass != "manipMove" && $ctxClass != "manipRotate" && $ctxClass != "manipScale"); if (2 == $opt) { // Toggle strsTweakModeSetTool(!`manipMoveContext -q -tweakMode Move`); } else if (1 == $opt) { // Enable global string $gLastSacredTool; if ($switchToMoveCtx) { global string $gCurrentSacredTool; $gLastSacredTool = $gCurrentSacredTool; setToolTo moveSuperContext; } else { $gLastSacredTool = ""; } strsTweakModeSetTool(1); } else if (0 == $opt) { // Disable strsTweakModeSetTool(0); global string $gLastSacredTool; if ("" != $gLastSacredTool && `contextInfo -q -exists $gLastSacredTool`) setToolTo $gLastSacredTool; } } } global proc strsTweakMode(int $option) { evalDeferred(("strsTweakModeDoIt(" + $option + ")")); }