Thread: X-Ray shortcut
View Single Post
# 5 31-12-2004 , 04:18 AM
R-Tillery's Avatar
Subscriber
Join Date: May 2003
Location: Ventura California
Posts: 966
Heres the one I use, its a lot better. do the script editor thing.
____________________________________________


// 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;

// Result: 0 //