// =========================================================================== // 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. // =========================================================================== global proc typeTRSToolOptionsPopup() { string $toolName = `currentCtx`; string $sel[] = `ls -sl`; if (0 == size($sel) || 0 == `objExists $sel[0]`) return; string $conns[] = `listConnections($sel[0]+".message")`; string $typeNode = ""; for ($node in $conns) { if (nodeType($node) == "type") { $typeNode = $node; break; } } if ("" == $typeNode) return; int $mode = `getAttr ($typeNode + ".manipulatorMode")`; menuItem -label (getPluginResource("Type", "kTypeToolCharacterLbl")) -rp "W" -cb (0 == $mode) -c ("setAttr " + ($typeNode + ".manipulatorMode") + " 0"); menuItem -label (getPluginResource("Type", "kTypeToolWordLbl")) -rp "N" -cb (1 == $mode) -c ("setAttr " + ($typeNode + ".manipulatorMode") + " 1"); menuItem -label (getPluginResource("Type", "kTypeToolLineLbl")) -rp "E" -cb (2 == $mode) -c ("setAttr " + ($typeNode + ".manipulatorMode") + " 2"); menuItem -label (getPluginResource("Type", "kResetAllManipsAnn")) -rp "S" -c ("typeTRSTool_ResetAllCurrent;"); menuItem -label (getPluginResource("Type", "kResetManipsAnn")) -rp "SW" -c ("typeTRSTool_ResetCurrent;"); }