Skip to content

Instantly share code, notes, and snippets.

@mkober
Created October 8, 2013 18:37
Show Gist options
  • Select an option

  • Save mkober/6889412 to your computer and use it in GitHub Desktop.

Select an option

Save mkober/6889412 to your computer and use it in GitHub Desktop.
Maya X-Ray on Selected Objects
global proc r_superXray()
{
string $select[] = `ls -sl`;
int $sizes = `size$select`;
if ($sizes >= 1)
{
string $mySel[] = `ls -sl -dag -s`;
for ($s in $mySel)
{
int $xState[] = `displaySurface -q -xRay $s`;
displaySurface -xRay ( !$xState ) $s;
}
}
if ($sizes < 1)
{
string $all[] = `select -ado`;
displaySurface -xRay 0;
select -cl;
$currentPanel = `getPanel -wf`;
$mode = `modelEditor -q -xray $currentPanel`;
modelEditor -edit -xray (!$mode) $currentPanel;
}
}
r_superXray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment