// ----------
// dlXray.mel
// ----------
// DATE: 05/24/2003, rev. 06/17/2003
//
// AUTHOR: David LeFebvre
//
// COMPANY: PL Studios, Inc. Digital-Tutors.com
//
// DESCRIPTION: This script will toggle the x-ray display of the shape
// nodes for all selected surfaces.
// USAGE: select one or more surfaces, execute the procedure
//
// EXAMPLE: select -r spere1; dlXray;
//
// DISCLAIMER: Use this an all scripts at your own risk. PL Studios,
Inc. will not be responsible
// for any data loss or file corruption from the use of this
script.
global proc dlXray (){
// declare variables
string $selected[];
string $hilited[];
string $object;
int $test[];
int $hold;
// assign values to variables for selected objects
$selected = `ls -sl -dag -ap -typ surfaceShape`;
$hilited = `ls -hl -dag -ap -typ surfaceShape`;
// loop through any objects in component mode
// and toggle their x-ray display
for ($object in $hilited){
$test = `displaySurface -q -xRay $object`;
$hold = $test[0];
if ($hold != false)
displaySurface -xRay false $object;
else
displaySurface -xRay true $object;
// clear test variable
clear $test;
}
// loop through any objects in object mode
// and toggle their x-ray display
for ($object in $selected){
$test = `displaySurface -q -xRay $object`;
$hold = $test[0];
if ($hold != false)
displaySurface -xRay false $object;
else
displaySurface -xRay true $object;
// clear test variable
clear $test;
}
// clear selection variables
clear $selected;
clear $hilited;