Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Technical Issues (https://simplymaya.com/forum/forumdisplay.php?f=23)
-   -   Shortcut for X-RAY (https://simplymaya.com/forum/showthread.php?t=26777)

osabando 01-07-2007 06:26 AM

Shortcut for X-RAY
 
How can do you do a shortcut for the X-Ray opcion on the shelf?, or as a keyboard shortcut, it doesn't appear on the hotkeys menu or as a command on the script editor for copying it

Thanks

01-07-2007 06:16 PM

Why didnÕt you just Google ÒX-Ray MEL scriptÓ?

Shogunato 22-07-2007 04:28 PM

open up your script editor in maya.
go to Edit > Clear All. then paste the following to the bottom section of the script editor (Its called Input work area)


// 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.");


after pasting it. highlight the whole code (ctrl + A) then go to File > Save Selected to Shelf, give a name to it. then it'll add the mel script onto the shelf that is active.

Enjoy


All times are GMT. The time now is 12:25 AM.

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