lol, thats a useful shortcut way of doing it funky 
Didnt even know it was there (as I'm still fairly new to Maya's programming capabilities).
I can easily add that in python like below:
Python:
Code:
# 1) open the script editor and copy the code below into it
def toggleXray():
if mc.displaySurface(query=True, xRay=True) == [1]:
mc.displaySurface(xRay=False)
else:
mc.displaySurface(xRay=True)
# 2) Now copy this into the script editor, highlight it and middle drag to your shelf.
# When asked what type of code it is choose Python. You should now have a toggle for xray on the selected objects
toggleXray()
N.B, If anyone wants to use it you'll need to add it to a file and include it to run it whenever you use maya.
How do you go about it in Mel?
I tried with the following code and variations but it doesnt seem to like using attribute values as variable comparisions?
Mel:
Code:
int $xRayVar = `displaySurface -q -xRay`;
if ($xRayVar) {
displaySurface -xRay false;
} else {
displaySurface -xRay true;
};
Si
Last edited by t1ck135; 01-10-2007 at 01:55 AM.