View Single Post
# 3 07-08-2008 , 12:44 PM
Subscriber
Join Date: Dec 2004
Location: Netherlands
Posts: 45
Hi,

I use a little script for Xray (see below). If you want to use it then paste it into the script editor and select it, then middlemouse drag it onto the shelf. Select a mesh and hit the button, to turn it off select the mesh again and hit the button again.


{
int $value;
int $temp[];
string $buffer[];
string $firstInstance;
string $select_all[] = `ls -sl`;
string $comp_selection[] = `listRelatives -typ surfaceShape -parent $select_all`;
string $obj_selection[] = `ls -sl -dag -ap -typ surfaceShape`;

for ($obj in $obj_selection)
{
$numTokens = `tokenize $obj "|" $buffer`;

//We might be working on an instance, so check to see if we need to skip
if ($numTokens > 1)
{
//If the next object is an instance of the last one skip
if (strcmp ($firstInstance, $buffer[1]) == 0)
{
continue;
}
$firstInstance = $buffer[1];
}

$temp = `displaySurface -q -x $obj`;
$value = $temp[0];
if ($value == 1)
{
displaySurface -x 0 $obj;
}
else
{
displaySurface -x 1 $obj;
}
}


for ($obj in $comp_selection)
{
$temp = `displaySurface -q -x $obj`;

$value = $temp[0];
if ($value == 1)
{
displaySurface -x 0 $obj;
}
else
{
displaySurface -x 1 $obj;
}
}
};



Hope this is what you mean.