Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 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.");

# 2 29-12-2004 , 09:34 PM
Subscriber
Join Date: Oct 2003
Location: Scotland
Posts: 74
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....

# 3 30-12-2004 , 09:30 AM
blomkaal's Avatar
Subscriber
Join Date: May 2004
Location: Denmark
Posts: 816
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...


Last edited by blomkaal; 30-12-2004 at 09:35 AM.
# 4 30-12-2004 , 12:23 PM
Ah works great thanks allot, user added image do you also know how i can modify the icon?

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

# 6 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 user added image


Last edited by pixelsoul; 01-01-2005 at 06:23 PM.
# 7 01-01-2005 , 09:27 PM
R-Tillery's Avatar
Subscriber
Join Date: May 2003
Location: Ventura California
Posts: 966
It works gooduser added image

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads