Maya Hotkeys and UI

Toggle the X-Ray-command


// get last panel that recieved focus
string $panel = `getPanel -wf`;
// toggle xray mode
modelEditor -e -xray ( !`modelEditor -q -xray $panel` ) $panel;

go up

Toggle the Grid


string $panel = `getPanel -wf`;
modelEditor -e -grid ( !`modelEditor -q -grid $panel` ) $panel;

go up

Toggle Wireframe on Shaded


string $panel = `getPanel -wf`;
modelEditor -e -wos ( !`modelEditor -q -wos $panel` ) $panel;

go up

Zoom in graph editor constrained in one axis


press alt, shift, left and middle mousebutton, also works in all other 2deditors like trax and dopesheet

Answer from Maya-Listserv on

go up

Looking at selection in all Views command


// ** BEGIN MEL **
// Get an array of all visible panels
string $panels[] = `getPanel -vis`;
// Use a for() loop to iterate through the panel array
for ( $panel in $panels )
// Assert that this is a modelPanel
if ( `getPanel -typeOf $panel` == "modelPanel" )
// Get the Camera for this panel
string $camera = `modelEditor -q -camera $panel`;
// Perform the viewLookAt
viewLookAt $camera;
// ** END MEL **

Answer from Maya-Listserv on (Bryan Ewert, Fri, 12 Jan 2001 12:13:38)

go up


Other way to work with framing selection (Hotkey):


string $currentCamera = `getPanel -withFocus`;
string $camera = `modelEditor -q -camera $currentCamera`;viewLookAt $camera;

Answer from Maya-Listserv on (Roger Klado, Sat, 13 Jan 2001 14:00:41)

go up


Poly blackface culling hotkey


int $test[];
$test =`polyOptions -query -bc`;
if ($test[0] == 1)
polyOptions -fb;
if ($test[0] == 0)
polyOptions -bc;

Answer from Maya-Listserv on (Mon, 5 Feb 2001 18:18:39)

go up

Recreating the Texture View marking menu

  1. Load up "/scripts/others/ModelEdMenu.mel" into your text editor.
  2. Add the indicated lines to the following block:
    if( $panelControl != "" )
    // ** Add these lines to bottom of this block **
    string $ctrlMenuName = ( $panelName + "CtrlPop" );
    if ( !`popupMenu -exists $ctrlMenuName` )
    popupMenu -parent $panelControl -mm true -ctl true -b 3 -aob true $ctrlMenuName;
    textureWindowCreatePopup($panelName, "modelPanel", 1);
  3. Restart Maya.
  4. In any modelPanel, hold down CTRL and click the RMB.

Answer from Maya-Listserv on (Bryan Ewert, Fri, 05 Jan 2001 12:01:20)

go up

How to round floats


float num = 4.5667;
num = (int) (( num + .0005) * 1000);
num = (num / 1000);
solution = 4.567


You can use the classic round to nearest integer trick :
add 0.5 to the float value and cast it to a int.
float $f;
int $i;
$i = ( int) ( $f + 0.5); // round to nearest integer

Answer from Maya-Listserv on (Cheryl Rice and Stephane Deverly)

go up

Toggle for Push and Pull in Artisan


Toogle for Push / Pull:

if (`puttyCtx -q -mtm "puttyContext"` == "push" ) puttyCtx -e -mtm "pull" `currentCtx`;
else puttyCtx -e -mtm "push" `currentCtx`;

Toogle for all options:

string $sculpt_state;
$sculpt_state = `puttyCtx -q -mtm "puttyContext"`;
switch ($sculpt_state)
case "push":
puttyCtx -e -mtm "pull" `currentCtx`;
case "pull":
puttyCtx -e -mtm "smooth" `currentCtx`;
case "smooth":
puttyCtx -e -mtm "erase" `currentCtx`;
puttyCtx -e -mtm "push" `currentCtx`;

go up

Toggle for Move in Object and World Space


if (`manipMoveContext -q -mode Move` == 0) manipMoveContext -e -mode 2 Move;
else manipMoveContext -e -mode 0 Move;

go up