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.

16 comments:

  1. Gary,

    You're Havenhurst video on youtube was so inspirational! Beautiful work man! How did you learn to do all those disciplines? I like you am self taught in animation, but want to branch out to the other areas of cg. Any suggestions on training material that you may have used to help you along the way?

    Keep up the great work.

    -George

    ReplyDelete
    Replies
    1. To start I highly recommend 3D Buzz's "Mastering Maya The Fundamentals"; 82 project-based hours of training for less than $100. In it you get to experience a little bit of everything, you even build a controls interface window for a character in MEL. Their "Mastering Maya Advanced Modeling" is over 100 hours and is about the same price; as they say and I agree, it's the best modeling training on the planet.

      Also the Maya user guide (Maya Help) is really good too. Before each main section (such as hair and fur sections), there's an intro of many important concepts and I first read those help file intro sections when I'm doing something for the first time. You can't remember everything but it's good to know as much as possible before you do serious stuff so that you feel comfortable with the software. Sometimes I learn the basics (such as getting a feel for Nuke for compositing Havenhurst), and then coming back to increase my understanding just before compositing another project. Understanding the details are especially important when rigging, and there's many free tutorials, on almost anything, scattered over the internet through blogs and free videos (such as YouTube), so you don't necessarily have to spend a lot of money learning these things.

      As for rendering, that takes some time to understand. When I was doing Havenhurst I wasn't too sure about how to get a good exposure and how much tone mapping to use, along with what exactly goes into making an image look good. After that project I delved into seriously learning photography principles (from all the free tutorials on the "Cambridge In Colour" website), and that actually helped me way more than any tutorial on how to render in Maya. My images look far better now (you'll see in my next project), though it will be quite some time before I can produce beautiful photo-realistic renders. Be patient and don't get discouraged if you're having trouble figuring something out, and keep practicing and you'll eventually get very good at what you want to do.

      Hopefully what I've said here will give you some ideas as to where to get started. Thanks for asking and commenting by the way!

      Delete
  2. Great advice! I figured you'd mention 3dbuzz after I saw some of your older projects. hehe. good stuff. I like your advice on rendering and will try to take a similar route on everything. I look forward to seeing your newest projects.

    Thanks again,

    George

    ReplyDelete
  3. Gary, i checked out the photography site. Looks good. I still wouldn't mind some links to 3d rendering tutorials that you may have used though ;) Anything you felt was useful?

    Keep up the great work.

    -George

    ReplyDelete
    Replies
    1. Sorry about the wait, I haven't checked my blog in a week. Okay, so with rendering, there's a lot out there.

      When I was setting up Havenhurst I knew enough to produce a decent image, but it's obviously not as good as the completely realistic images you'll see from professionals. I've gotten quite a bit better since. Rendering involves several different topics:

      1) Painting textures. For example, if you look at human skin, most of the "detail" you see is in the highlights of the little bumps, not in the color; bump/displacement and how that plays with your reflection/spec highlights matters a whole lot more than color, in most cases.

      2) Linear lighting workflow. Probably the most important aspect to rendering. You want the data the renderer is taking to be fully "linear". Just be aware of what's going on so you can compensate for the gamma. The videos here by Zeth Willie explain linear workflow: http://vimeo.com/8119194

      3) Materials. You'll want to understand how the materials work, and be familiar with the Hypershade, along with utility nodes and such. Again, you don't have to know everything, but certain nodes, such as "ramp", "multiplyDivide", "layeredTexture" are very important to be aware of.

      The mental images architecture and design shader library:
      http://www.mentalimages.com/fileadmin/user_upload/PDF/arch_and_design.pdf

      Here's a tutorial on sub-surface scattering:
      http://www.lamrug.org/resources/doc/sss-skin-tutorial.pdf

      4) Lighting: For example, to create a virtual "grey ball" for your initial exposure setup in Maya, just create a sphere and give it a material and set the color to 0.18 (50% grey perceptually) with a 2.2 display gamma. Your eyes are the final judgement to producing images, not radiometry (my previous misconception), though radiometry and photometry can be useful when you're trying to light completely in a physical manner.

      5) Texture-filtering: All your textures should be mipmap, with 0.5 in the file node "Filter" under the Effects tab (not Pre Filter). This should be fine for most cases. Displacements should have filtering set to "Off". For Havenhurst I had filtering off for everything. This causes sub-pixel flickering and isn't the right way to work.

      6) Tone mapping and exposure are very important. Using the mia_exposure_photographic will help you when you work, but you don't have to use it. It helps tone down the highlights, which is how your eye works and so you'll be getting realistic results in the Render View. Once you're ready to render, you can turn off all non-linear mapping effects on mia_exposure_photographic (by setting "Burn Highlights" to 1, "Crush Blacks" to 0, and "Gamma" to 1) before you do the final render. Render OpenEXR 16-bit Half floating point at least, so that you have more control in After Effects, Photoshop, Nuke, Maya Composite, etc.

      7) Rendering in passes gives you extra control in compositing, but there's some caveats when using them. The details are described in the Maya help file in the section on Render Passes for Mental Ray materials:
      http://download.autodesk.com/global/docs/maya2013/en_us/index.html?url=files/Shading_Nodes_mental_ray_for_Maya_nodes.htm,topicNumber=d30e671093,hash=WS1A9193826455F5FF-12BA6B3A11A9C207460-7BC7

      If you start off with the foundational tips I just gave, you won't have to tweak as much to get good lighting, and you'll be using relatively modern techniques to produce your images.

      Delete
  4. Awesome dude, thank you! This is great info. Sounds like you attained this kind of knowledge from various sources right? I appreciate you breaking it down for me and doing the leg work. hehe. I have built up a library of training material over the years and sometimes its overwhelming and i don't know where to focus. These 7 points will help me focus.

    Thanks again.

    ReplyDelete
    Replies
    1. You got it. It's not something you can learn from one website or another, but the most important information is scoured over the internet, and a lot of it is free. For example, a few weeks ago I found a great blog called "Elemental Ray", for using Mental Ray in Maya.

      http://elementalray.wordpress.com/

      The techniques on this blog are modern. The reason I didn't mention it is because some of the techniques (like Unified Sampling) require the latest versions of Maya.

      For example, the old "Adaptive Anti-Aliasing" image sampling method is replaced by "Unified Sampling", and you can access it in Maya 2012. In Maya 2013 it's even better. Unified Sampling is accessed through string options on the "miDefaultOptions" DG node. These are "unsupported" workflows because Autodesk hasn't implemented these features officially, though Mental Ray is now a plugin in Maya 2013 so it should be easier to update in the future.

      Render Passes work with Unified Sampling too. As an example of the most advanced free information on Render Passes in Maya, you can check out this document:

      http://images.autodesk.com/adsk/files/maya_render_pass_concepts_and_techniques_whitepaper_us.pdf


      I haven't read that document yet (and it's not really neccessary), though I will be taking a good look at it when I do my render passes setup for my currrent project.

      As for learning all these topics, I recommend typing up a document and "queuing" things you want to learn in an order, so you don't have to remember it all. For example, overall, the method of my learning is this: Modeling and UVs, Shading, Rendering and Compositing, Character/Creature Rigging (I'm on that now), Animation, Dynamics, etc. Also, you can download web pages of tutorials you like (such as with the free program HTTrack), and videos from YouTube, Vimeo, etc. So you can create your own archives of tutorials that don't force you to rely on the internet.

      My architectural projects allowed me to practice modeling and rendering, but I'm learning more with my current project, while improving on everything else I already know. You get the idea. It's sort of cumulative. Yes, it is a lot to learn, and you'll always learn new things, but I think, after a few years, you know all the "basics" and then it starts to pay off. You will be able to focus on the art much more. You'll eventually be able to produce impressive work from start to finish. I'm not really interested in stills, I like to make animations. The entire production pipeline starts with the custom computer build and ends with authoring the Blu-Ray/DVD, and everything in between!

      But you have to start somewhere and in my opinion, go with "3D Buzz - Mastering Maya The Fundamentals". It really is great and gets you off your feet to be a 3D generalist. That's my best recommendation to start with.

      Delete
  5. Thanks, I never heard about gesture control tip, its really good.

    ReplyDelete
  6. Read your whole blog its quite edifying, very helpful for the newbies of our industry

    ReplyDelete
  7. Hey Gary,

    Been over a year since your last post. What's new? :)

    Hope all is well.

    -George

    ReplyDelete
    Replies
    1. Not too much new, I've been busy with other endeavors; 3D stuff is a hobby for me, so I sometimes take time off from it, and I don't get too many hours a week in on it. However I'll be coming back to spending time on 3D computer graphics work eventually. I have two dormant projects in the making that, when complete, will have plenty of content associated with them, including commentary video series on YouTube. There's, as always, a whole lot to learn. I'll be back and with much more interesting stuff related to my projects and more advanced tips later on!

      Delete
  8. I've just read your post. It's awesome! Great stuff shared here with good videos and information...

    Connie Jordan-Carmichael | Connie Jordan-Carmichael USA

    ReplyDelete
  9. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

    Web Design Company in Chennai

    ReplyDelete
  10. I read your articles very excellent and the i agree our all points because all is very good information provided this through in the post.

    Digital Marketing Company in Chennai

    ReplyDelete
  11. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

    Digital Marketing Company in Chennai

    ReplyDelete
  12. Really Good article.provided a helpful information.keep updating...
    E-mail marketing company in india

    ReplyDelete