View Single Post
# 5 28-12-2002 , 11:45 PM
dannyngan's Avatar
Registered User
Join Date: Dec 2002
Location: Seattle, WA
Posts: 1,154
Damn, you beat me to starting a new thread. I was just about to do the same thing. Oh well. user added image

Here's my first contribution to this thread. A couple of simple scripts that work best when mapped to hotkeys:

Code:
/*

--------------------

toggleXray v1.0

--------------------

Created: Dec 15, 2002
Modified: Dec 15, 2002

--------------------

Danny Ngan
dannyn@mac.com
https://www.dannyngan.com

--------------------

Toggles Xray mode on/off in the active view panel. Works best when mapped to a hotkey.

--------------------

*/


global proc toggleXray()
{

	$currentPanel = `getPanel -withFocus`;
	$state = `modelEditor -q -xray $currentPanel`;
	modelEditor -edit -xray (!$state) $currentPanel;

}
-----

Code:
/*

--------------------

toggleWireframeShaded v1.0

--------------------

Created: Dec 15, 2002
Modified: Dec 15, 2002

--------------------

Danny Ngan
dannyn@mac.com
https://www.dannyngan.com

--------------------

Toggles Wireframe on Shaded mode on/off in the active view panel. Works best when mapped to a hotkey.

--------------------

*/


global proc toggleWireframeShaded()
{

	$currentPanel = `getPanel -withFocus`;
	$state = `modelEditor -q -wos $currentPanel`;
	modelEditor -edit -wos (!$state) $currentPanel;

}
You can download them here if copy/paste doesn't work for you:

https://www.dannyngan.com/maya/mel/to...rameShaded.mel
https://www.dannyngan.com/maya/mel/toggleXray.mel


Danny Ngan
Animator | Amaze Entertainment
my website | my blog | my job

Last edited by dannyngan; 28-12-2002 at 11:48 PM.