////////////
//
//  Script: senToggleToolModes 0.1.2
//  Updated: 8 May 2008
//  Compatibility: Maya 7 and higher
//  Probably works with earlier versions, too.
//
//
//  Written by Sven-Erik Neve
//  Website and contact info: www.seneve.de
//  Bugs, comments, questions or suggestions? Get in touch!
//
//  Inspired by the 3DBuzz forums' users DezFX and volXen:
//  http://www.3dbuzz.com/vbforum/showthread.php?t=69730
//  http://www.3dbuzz.com/vbforum/showthread.php?t=89899
//
//
//  Usage:
//  Execute the command senToggleToolModes.
//
//
//  Installation:
//  Copy this source code within a MEL file to one of your
//  scripts folders, for example on Windows XP 32-bit to the
//  folder \My Documents\maya\<version>\scripts. Start Maya
//  or (if it is running) use the rehash command to make Maya
//  aware of the newly copied script. Execute the script with
//  the senToggleToolModes command.
//
//
//  Purpose:
//  By default you change the Move and Rotate tools' settings
//  in the appropriate Tool Settings. Instead of having to open
//  the Tool Settings and for example manually setting your
//  Rotate tool to Local mode this script toggles through the
//  commonly used modes. If the Move tool is active it toggles
//  through the tool's Local, World and Normal Translate modes.
//  If the Rotate tool is active this script toggles through
//  the tool's Local and World Arcball modes.
//
////////////

global proc senToggleToolModes() {
	// Which tool is active?
	string $currentTool = `currentCtx`;

	// If the Move tool is active toggle through its modes.
	if ($currentTool == "moveSuperContext")
	{
		if (`manipMoveContext -q -m Move` == 2)
		manipMoveContext -e -m 3 Move;
		else if (`manipMoveContext -q -m Move` == 3)
		manipMoveContext -e -m 1 Move;
		else manipMoveContext -e -m 2 Move;
	}

	// If the Rotate tool is active toggle through its modes.
	if ($currentTool == "RotateSuperContext")
	{
		if (`manipRotateContext -q -m Rotate` == 0)
		manipRotateContext -e -m 1 Rotate;
		else manipRotateContext -e -m 0 Rotate;
	}
}

senToggleToolModes MEL-Skript. Wenn das Move-Tool aktiv ist, schaltet dieses Skript durch die Translate-Modi des Tools. Ist das Rotate-Tool aktiv, schaltet es durch die Arcball-Modi des Tools. Auf die Art minimiert es die Notwendigkeit, die Tool Settings zu benutzen. Das Skript ist nützlich, wenn Sie zum Beispiel Vertices bearbeiten und schnell ein paar von ihnen entlang ihrer Normalen bewegen möchten. Lassen Sie das Skript zum Normal-Translate-Modus umschalten und es kann losgehen. Auf ähnliche Weise erlaubt ihnen das Skript, zwischen dem Local- und World-Arcball-Modus hin- und herzuschalten. Nützlich zum Beispiel für gruppierte Objekte.

Inspiriert von den Tipps der 3DBuzz-Forenmitglieder volXen und DezFX.

Dieses Skript herunterladen (1 KiByte)
Maya 7 oder höher, funktioniert vermutlich auch mit früheren Versionen.