// -------------------------------------------------------------------------- // toggleAffected.mel - MEL Script // -------------------------------------------------------------------------- // // DESCRIPTION: // Changes display options so XRay mode is on or off. // I usually bind to CTRL+x // // USAGE: // source "toggleXRay.mel"; toggleXRay(); // // AUTHORS: // Michael B. Comet - comet@comet-cartoons.com - http://www.comet-cartoons.com/ // // COPYRIGHT: // Copyright ©2004 Michael B. Comet - All Rights Reserved // // VERSIONS: // 1.00 - 07/05/2004 - Michael B. Comet - Initial Release // // -------------------------------------------------------------------------- /* * toggleXRay() - Main entry */ global proc toggleXRay() { string $currentPanel = `getPanel -underPointer`; if ("" == $currentPanel) { $currentPanel = `getPanel -withFocus`; } if ("" != $currentPanel) { string $panelType = `getPanel -typeOf $currentPanel`; if ($panelType == "modelPanel") { int $state = `modelEditor -q -xray $currentPanel`; modelEditor -e -xray (!$state) $currentPanel; } } } // --------------------------------------------------------------------------