// =========================================================================== // 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: Dec, 2003 // // // // // // displayJointLabels(int $display) // // // None // // // Script to turn on and off the display of joint labels on the selected hierarchy. // // // int $display: // 0 = turn off the display. // 1 = enable display // 2 = toggle display // 3 = disable all // 4 = enable all // // ///////////////////////////////////////////////////////////////////////// global proc displayJointLabels(int $display) { string $joints[]; int $onOff; if ($display > 2 /* enable/disable all */) { $joints = `ls -type joint`; } else { $joints = `ls -sl -dag -type joint`; if (size($joints) == 0) { error( (uiRes("m_displayJointLabels.kNoJoints"))); } } switch ($display) { case 0: case 1: $onOff = $display; break; case 2: { int $curr = `getAttr ($joints[0]+".drawLabel")`; $onOff = ! $curr; } break; case 3: $onOff = 0; break; case 4: default: $onOff = 1; break; } for ($jnt in $joints) { setAttr ($jnt+".drawLabel") $onOff; } }