PDA

View Full Version : creating hotkeys for XRay


ZippZopp
03-07-2003, 03:15 AM
i've been modeling a head using the polygon proxy mode. i learned it in Maya 4.5 Fundamentals. Most of the time i need to be in Xray mode so i can see exaclty where my vertices are on the cage i'm using to model. is there a way to set a hotkey for turning XRay mode on and off. i switch it quite often and it would be a lot easier with hotkeys than constantly goin up to the menu of the viewport.

stunndman
03-07-2003, 03:21 AM
a basic approach to setting up hotkeys

figure out what command does the job

to do that open your script editor and set Script->Echo All Commands

then do it by hand (set and unset) and you will see what commands were issued

now create a custom hotkey in your hotkey editor

now for the x-ray command you will have to additionally query the panel it should set x-ray shading for - that's another issue

i guess the best will be to get a pre-made script from highend3d.com - i'm pretty sure there a many for toggling the x-ray shading

ZippZopp
03-07-2003, 03:28 AM
thanks a lot! i'll try doing it on my own to see if i can learn it, if not i'll check out highend3d.com thanks again!

stunndman
03-07-2003, 03:40 AM
this are the commands to query the panel - the first one queries the panel with focus and the second one the panel under pointer

string $panel = `getPanel -wf`;

string $panel = `getPanel -up`;

ZippZopp
03-07-2003, 04:06 AM
i found one that at highend3d, that sets Alt-X to turn xray on and off. I have a marking menu set to Alt X. i open the script editor and found the area that tells it to use the Alt key. Optimally, i'd like to change it to the shift key, but i can't figure out how to do it

i found this at the end of the script.

hotkey -keyShortcut "x" -altModifier -name "xrayToolNameCommand"

i was able to change where it says altModifier to CtrlModifier and that sets it to the ctrl key. i also have a marking menu set for ctrl-x. so i need it to be the shift key. what do i type there? i've tried shift, shft, sht, sft....nothing works, what should i do? yes, i'm a noob, sorry for being kinda stupid

stunndman
03-07-2003, 04:14 AM
use the corresponding uppercase character

x or X (which is shift-x)

ZippZopp
03-07-2003, 04:18 AM
so simple, i didn't even think of it.....did i mention i'm a noob?

bambam
03-07-2003, 06:31 AM
look on my home page
I have a little script you can put on your shelf that will do this for ya

webster
03-07-2003, 07:28 AM
look on highend / mel-scripts / Interface and Display / toggleTools

you get a bunch of usable toggle functions

dmcgrath
03-07-2003, 08:24 AM
here is the code that I made for turning on all the windows at once:

modelEditor -e -xray 1 modelPanel1;
modelEditor -e -xray 1 modelPanel2;
modelEditor -e -xray 1 modelPanel3;
modelEditor -e -xray 1 modelPanel4;


and then off just replaces the 1 with a zero:

modelEditor -e -xray 0 modelPanel1;
modelEditor -e -xray 0 modelPanel2;
modelEditor -e -xray 0 modelPanel3;
modelEditor -e -xray 0 modelPanel4;

I have them on the shelf as buttons. But you can convert it to hotkeys. But if you use a hotkey setup, the -query window that stunndman wrote is definately the way to go.

bambam
03-07-2003, 11:22 AM
Originally posted by bambam
look on my home page
I have a little script you can put on your shelf that will do this for ya

I should have explained this more
the script uses a simple if/else statement which querys the current active panel window

If you don't like this on your shelf you can take the if/else statement and map it to a hot key or to a marking menu

CGTalk Moderation
01-14-2006, 02:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.