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.
A public location for displaying my 3D computer graphics and visual effects projects, along with sharing useful tips.
Showing posts with label maya basics. Show all posts
Showing posts with label maya basics. Show all posts
Monday, April 9, 2012
Sunday, October 23, 2011
Maya - Simple script for viewport performance increase
Here I will share a simple solution I made to a relatively simple problem; disable Maya's "Two-sided lighting" by default when you open Maya and open any scenes during the same session. Disabling this feature increases the default viewport performance by more than 100% (without hardware texturing enabled), and it also allows you to view reversed normals (due to single-sided lighting), easily seen on geometry that has been scaled negatively and had its transformation matrix frozen, as a nice bonus. This script uses a simple scriptJob to accomplish the task. For more details on scriptJobs and the available flags/arguments, view the MEL command reference.
An accompanying video demonstrating the result is located here:
http://www.youtube.com/watch?v=OvVB...ayer_detailpage
It's not necessary to watch however, as all information on how to get this to work is below:
This file you will be editing, initHUDScripts.mel, is stored in the path below, in Windows:
C:\Program Files\Autodesk\<MayaVersion>\scripts\startup\
It's highly preferable for you to copy the file and paste it into your user scripts directory under the (for example, in Windows and Maya 2011 x64) "/UserName/Documents/maya/2011-x64/scripts" settings folder. This way, if you make a mistake, you will be able to revert back to Maya's default script by just deleting your copy of the script. This script will work with previous versions of Maya, and should benefit all Maya users. I highly recommend you try it, especially if you deal with polygon heavy scenes.
I should make note that to get the most out of this script, you should know it operates on the default 4 camera panels. Under the menu Window - Settings/Preferences - Preferences, in the UI Elements tab, you'll see a "Panel Configurations" rollout. Uncheck the options "Save panel layouts with file", and also uncheck "Restore saved layouts from file". This allows the script to disable "Two-sided Lighting" on the default 4 viewports when you open any scene or create new ones; persp, top, front, and side.
Note that some objects in Maya, such as the muscle objects of the muscle system, are polygonal, so you might see mirrored muscles appear flat black, which is slightly inconvenient if you need to edit them; simply enable "Two-sided Lighting" manually for those certain but overall very few circumstances.
Append the lines below to your copy of the "initHUDScripts.mel" script:
// CUSTOM SETTINGS BELOW
// Set Two-sided lighting to off in default 4 views.
modelEditor -e -twoSidedLighting false modelPanel1;
modelEditor -e -twoSidedLighting false modelPanel2;
modelEditor -e -twoSidedLighting false modelPanel3;
modelEditor -e -twoSidedLighting false modelPanel4;
// Run a script job when a scene is opened/created.
string $setupCommands001 = "modelEditor -e -twoSidedLighting false modelPanel1; modelEditor -e -twoSidedLighting false modelPanel2; modelEditor -e -twoSidedLighting false modelPanel3; modelEditor -e -twoSidedLighting false modelPanel4;";
scriptJob -e "NewSceneOpened" $setupCommands001;
// END CUSTOM SETTINGS
An accompanying video demonstrating the result is located here:
http://www.youtube.com/watch?v=OvVB...ayer_detailpage
It's not necessary to watch however, as all information on how to get this to work is below:
This file you will be editing, initHUDScripts.mel, is stored in the path below, in Windows:
C:\Program Files\Autodesk\<MayaVersion>\scripts\startup\
It's highly preferable for you to copy the file and paste it into your user scripts directory under the (for example, in Windows and Maya 2011 x64) "/UserName/Documents/maya/2011-x64/scripts" settings folder. This way, if you make a mistake, you will be able to revert back to Maya's default script by just deleting your copy of the script. This script will work with previous versions of Maya, and should benefit all Maya users. I highly recommend you try it, especially if you deal with polygon heavy scenes.
I should make note that to get the most out of this script, you should know it operates on the default 4 camera panels. Under the menu Window - Settings/Preferences - Preferences, in the UI Elements tab, you'll see a "Panel Configurations" rollout. Uncheck the options "Save panel layouts with file", and also uncheck "Restore saved layouts from file". This allows the script to disable "Two-sided Lighting" on the default 4 viewports when you open any scene or create new ones; persp, top, front, and side.
Note that some objects in Maya, such as the muscle objects of the muscle system, are polygonal, so you might see mirrored muscles appear flat black, which is slightly inconvenient if you need to edit them; simply enable "Two-sided Lighting" manually for those certain but overall very few circumstances.
Append the lines below to your copy of the "initHUDScripts.mel" script:
// CUSTOM SETTINGS BELOW
// Set Two-sided lighting to off in default 4 views.
modelEditor -e -twoSidedLighting false modelPanel1;
modelEditor -e -twoSidedLighting false modelPanel2;
modelEditor -e -twoSidedLighting false modelPanel3;
modelEditor -e -twoSidedLighting false modelPanel4;
// Run a script job when a scene is opened/created.
string $setupCommands001 = "modelEditor -e -twoSidedLighting false modelPanel1; modelEditor -e -twoSidedLighting false modelPanel2; modelEditor -e -twoSidedLighting false modelPanel3; modelEditor -e -twoSidedLighting false modelPanel4;";
scriptJob -e "NewSceneOpened" $setupCommands001;
// END CUSTOM SETTINGS
Sunday, March 27, 2011
Maya - Numeric expressions in the Channel Box
This tip is fairly simple, but is quite useful to know; I use this almost on a daily basis for various tasks.
Within the Channel Box, you're able to use simple math expressions, for example by selecting an attribute and multiplying it by 5. This also works on multiple selections of attributes, and in the Attribute Spread Sheet. Let's take a look.
As an example, let's say you want to scale an object up to twice its size, for each X Y and Z component, essentially doing a uniform scale. Aside from manually using a calculator (calc.exe in Windows), you might think of doing "Edit > Freeze Transformations", then selecting all the scale channels and entering "2". However, there's a more proper method, so let's try the math operators instead. Select all the scale channels and enter *=2 as shown below.
Now your object will double in size, uniformly multiplying each selected attribute by 2. From the Maya help file on attribute entry, here's the syntax and available options:
To enter a value relative to the current one:
- Type +=n to add n to the current value.
- Type -=n to subtract n from the current value.
- Type *=n to multiply n by the current value.
- Type /=n to divide the current value by n.
- % as a suffix indicates a percentage-based operation (For example, +=10% adds 10% of the current value to each selected value).
Though the Status Line includes an option for "Relative Transform" entry, I find this method to be more flexible, as it allows you to operate on any attributes shown in the Channel Box, Component Editor, and Attribute Spread Sheet. Another example of how useful it is: Halving the intensity of a selection of lights that all have different intensities with *=.5
You'll use this more than you might think.
Subscribe to:
Posts (Atom)
