Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   X-Ray shortcut (https://simplymaya.com/forum/showthread.php?t=14860)

pixelsoul 29-12-2004 05:46 PM

X-Ray shortcut
 
In the tutorials you use an X-Ray shortcut now ive found a script which can do this only it does not say where i should put this?

And how can i make it a button on the custom menu ?

// Toggle Xray
//

string $visPanel[]=`getPanel -vis`;
int $mode;
if (size($visPanel)>0)
{
for ($panel in $visPanel)
{
if (`match "^modelPanel" $panel`=="modelPanel")
{
$mode=`modelEditor -q -xray $panel`;
if ($mode>0)
modelEditor -e -xray 0 $panel;
else
modelEditor -e -xray 1 $panel;
}
}
print ("\nxray="+$mode+".");
} else
print ("\nNo model panels to modify.");

keef 29-12-2004 09:34 PM

Run in the script editor (bottom-left bottom in UI) from the pull-down menu, in the script editor, you can specify a shelf item....

Hope this helps....

blomkaal 30-12-2004 09:30 AM

Or you can run the script, select it in the script editor, and MMB drag it onto the shelf...

EDIT: The other way is probably better since you can then name the script...

pixelsoul 30-12-2004 12:23 PM

Ah works great thanks allot, :D do you also know how i can modify the icon?

R-Tillery 31-12-2004 04:18 AM

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

pixelsoul 01-01-2005 06:20 PM

hmm your does not seem to work? also why is yours better ?

Ah nevermind i see nw it only x-rays selected parts this is better thanks ;)

R-Tillery 01-01-2005 09:27 PM

It works good;)


All times are GMT. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018