Monday, April 9, 2012

Maya - Gesture-based transforms and fast marking menus

In this post I present two not very obvious, though fundamental and unique, aspects of Maya that will allow you to experience a significant increase in your productivity, especially with polygon modeling.

First, I'll go over gesture-based transforming, which has been in Maya probably since the first release of the software. This is incredibly useful and I use it exclusively for moving and scaling, as opposed to "clicking and dragging" on an axis manipulator. It essentially allows you to move/scale an object in any axis without having to touch the manipulator handle to enable an axis constraint. Unfortunately you can't "gesture-based" constrain rotate axes in the 3D panel view, though it's fine for rotating in screen space or for any previously selected axis. The video below (recorded and played back at real-time speed) demonstrates the efficiency of gesture-based transforming; after that, I'll explain how it's done.

You might be aware that some actions in Maya allow for a middle-mouse button gesture to constrain an operation. For example; you can select some faces on a polygon object, then hold "V" (for point snapping), hold "Shift" (to prepare a gesture-based axis constrain), then middle mouse gesture-based click on a vertex or point and your polygon faces will now line up (so long as you have "retain component spacing"/"keep spacing" in the Move tool marking menu disabled) based on the axis you selected (through the gesture-click, since you never directly clicked the axis manipulator). Gesture-based transforming allows you to move the mouse in the direction you want, and the software recognizes the direction closest to the axis direction (based on screen-space), and then instantly constrains that axis. This means that you don't have to click the axis to select it. The same can be applied for moving and scaling as shown in the video above.

To move and scale an object using gesture-based middle mouse constraining, you hold down "Shift", then press and hold the middle mouse button, and start moving in the direction you want. You can also start moving in the direction you want before you press and hold the middle mouse button. Maya then constrains the axis based on the closest direction you moved the mouse in as you pressed the middle mouse button (based on screen-space), and then you continue moving/scaling in that axis by holding the middle mouse button down and moving the mouse. You can then let go of the middle mouse button and gesture-constrain in another direction by again holding down the middle mouse button while moving in another direction. Unlike the middle mouse button, you don't have to release the "Shift" key during the task of switching manipulator handles via middle mouse button gesturing. Once you let go of the middle mouse button, the last selected axis will still be highlighted yellow, so if you want to select the screen-space handle, all you need to do is re-invoke the move tool by pressing "W"; same goes for Rotate ("E" key) and Scale ("R" key). In Maya 2010 and previous versions, the resetting of the axis manipulator to screen-space via re-invoking the tool doesn't work, so all you have to do is choose another tool (such as Select via the "Q" key) and then go back to the tool you want to move in screen space on (such as Move). This workflow is also useful for little tasks such as when you dolly a camera in but can't see the Move tool's manipulator handle (due to the pivot point being off-screen), so all you have to do is use the middle mouse gesturing technique. It takes a bit of practice to get it down, but it's completely worth adopting this highly-efficient workflow. I'll also add that if your middle mouse button is a bit difficult to press, this might not be very comfortable for you after a few hours; I use the Logitech G700 mouse which has an easy to press middle mouse button.

This method also works in other editors in Maya. For rotating in the UV Texture Editor, there's no need to press and hold the "Shift" key since there's only one possible way to rotate (screen-space). Additionally, to rotate in increments of 15 degrees, hold down the "J" key in the UV editor; the "J" key also works in the modeling panel for rotating incrementally, along with respecting the "discrete-rotate" toggle option in the rotate marking menu ("E+left mouse button") to set either absolute or relative incremental rotations. The video below (recorded and played back at real-time speed) demonstrates UV transformations effectively in move, scale, and rotate tools, using nothing but middle-mouse gesturing.

Now I'll mention the fast usage of marking menus. Maya includes more than a dozen default marking menus and you can create your own using "Window > Settings/Preferences > Marking Menu Editor". Most people know these sorts of things, but what is almost unknown is just how fast you can use marking menus. You're able to quickly gesture through a marking menu before it appears, meaning that once you memorize the locations of menu items (through any level of submenus), you'll be able to extend how much you get done in the same amount of time. You can access any option in the first sub-menu in less than ~0.5 seconds by doing a stroke in one direction and another direction to choose the option (the marking menu will not draw), perhaps add ~0.33 seconds to traverse each additional submenu; essentially one marking menu could have over 50 options each accessible in ~0.5 seconds by an experienced user, the benefit being that it's all bound to one hotkey.

The video below (recorded and played back at real-time speed) shows just how fast marking menus are able to be used once you're experienced, and specifically demonstrates just some of the actions possible with the default selection-type sensitive polygons marking menus ("Shift+right mouse button" and "Ctrl+right mouse button"). You'll see how fast polygon objects are able to be created (with interactive creation disabled), simple operations such as growing/shrinking a selection and pressing "G" to repeat, converting a face to contained edges and beveling, selecting edge rings and modifying normals, conversion from vertices to contained faces for selecting a face in the side view and extruding, creating equidistant edge splits and pressing "G" to repeat, all combined with gesture-based transforming to have a fast experience for modeling in Maya.

It's important to know a few subtle details of going through marking menus at such speeds. For the most optimal results, I've found a certain order of buttons should be pressed. First, you press whatever buttons are necessary to draw the marking menu (such as "Shift+RMB"), then quickly draw your stroke (which might take ~0.5 seconds total for an option in the first sub-menu), but don't let go of the original buttons used to draw the marking menu until the command is "reached" (highlighted) in the marking menu. After some practice it's not an issue at all and eventually you'll do it automatically through memorizing the expectation of when the menu item should be highlighted.

By combining gesture-based transforms and marking menus, you'll be even more efficient. I expect that some people may doubt that the videos shown in this post are "real-time", but they are (I was purposely slightly quicker than usual to show how fast it's possible to use the marking menus) and with experience you can be just as fast. What I've described are not by any means new features in Maya; they're fundamentals, and if you give these tricks a try you'll see the potential, especially once you start creating your own marking menus by using "Window > General Editors > Script Editor" with "Echo All Commands" enabled to take MEL commands and add them to a custom marking menu. For example, I created a marking menu and bound it to "Z+LMB" (using "Ctrl+Z" for Undo) for typical operations such as "Center Pivot", "Toggle Selection Handles", "Toggle Local Rotation Axes", various object and component "Selection Masks", etc.

Using marking menus aren't necessarily faster than using hotkeys, but the benefit is that your hand on the keyboard moves less and you can bind many options per hotkey. You definitely won't be able to fly through marking menus overnight, as it requires muscle memory of where the commands are, but with practice you'll probably agree that it's a great way to work.