Getting Started with Maya
Copyright Notice Autodesk® Maya® 2010 Software © 2009 Autodesk, Inc. All rights reserved. Except as otherwise permitted by Autodesk, Inc., this publication, or parts thereof, may not be reproduced in any form, by any method, for any purpose. Certain materials included in this publication are reprinted with the permission of the copyright holder. The following are registered trademarks or trademarks of Autodesk, Inc.
Contents Chapter 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 About the Getting Started lessons . . . . . . . . . . . . . . . . . . . . . 2 Before you begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Installing Maya . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Conventions used in the lessons . . . . . . . . . . . . . . . . . . . . . . 4 Using the lesson files . .
Introduction . . . . . . . . . . . . . Creating a new scene . . . . . . . . Primitive objects . . . . . . . . . . . The Toolbox: Layout shortcuts . . . The Toolbox: Transformation tools . The Channel Box . . . . . . . . . . Duplicating objects . . . . . . . . . Save your work . . . . . . . . . . . Beyond the lesson . . . . . . . . . . Lesson 3: Viewing the Maya 3D scene . . Introduction . . . . . . . . . . . . . Camera tools . . . . . . . . . . . . Workflow overview . . . . . . . . .
Adding polygons to a mesh . . . . . . . . Splitting polygon faces . . . . . . . . . . . Terminating edge loops . . . . . . . . . . Deleting construction history . . . . . . . Mirror copying a mesh . . . . . . . . . . . Working with a smoothed mesh . . . . . . Creasing and hardening edges on a mesh . Beyond the lesson . . . . . . . . . . . . . Lesson 2: Sculpting a polygon mesh . . . . . . . Introduction . . . . . . . . . . . . . . . . Open the scene for the lesson . . . . . . . Using Soft Select . . . . . .
Beyond the lesson . . . . . . . . . . . . . . . . . . . . . . . . . 179 Chapter 5 Subdivision Surfaces . . . . . . . . . . . . . . . . . . . . . . . 181 Introduction . . . . . . . . . . . . . . . . . . . . Preparing for the lesson . . . . . . . . . . . . . . Lesson 1: Modeling a subdivision surface . . . . . Introduction . . . . . . . . . . . . . . . . . Creating a subdivision surface . . . . . . . . Splitting a surface in polygon proxy mode . Extruding polygon faces . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . Open the first scene for the lesson . . . . . . . Creating clips with Trax . . . . . . . . . . . . . Changing the position of clips with Trax . . . . Editing the animation of clips . . . . . . . . . . Reusing clips within Trax . . . . . . . . . . . . Soloing and muting tracks . . . . . . . . . . . . Scaling clips within Trax . . . . . . . . . . . . . Open the second scene for the lesson . . . . . . Creating clips from motion capture data . . . .
Smooth binding a skeleton . . . . . . . . . . . . Skin weighting and deformations . . . . . . . . . Modifying skin weights . . . . . . . . . . . . . . Influence objects . . . . . . . . . . . . . . . . . . Beyond the lesson . . . . . . . . . . . . . . . . . Lesson 3: Cluster and blend shape deformers . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . Open the scene for the lesson . . . . . . . . . . . Creating a target object for a blend shape . . . . .
Viewing a normal map . . . . . . . . . . . . . . . . . . . . . . . 435 Beyond the lesson . . . . . . . . . . . . . . . . . . . . . . . . . 436 Chapter 9 Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 Introduction . . . . . . . . . . . . . . . . . . . . . . . Preparing for the lessons . . . . . . . . . . . . . . . . . Lesson 1: Rendering a scene . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . Open the scene for the lesson . . . . . . . . . . .
Open the scene for the lesson . . . Render the scene using raytracing . Render the scene using caustics . . Beyond the Lesson . . . . . . . . . Chapter 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520 . 521 . 526 . 532 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rendering Paint Effects strokes . . . . . . Paint Effects on 3D objects . . . . . . . . Creating a surface to paint on . . . . . . . Painting on objects . . . . . . . . . . . . Using turbulence with brush stroke tubes . Using additional preset brushes . . . . . . Mesh brushes . . . . . . . . . . . . . . . . Converting mesh strokes to polygons . . . Modifying a converted polygonal mesh . . Beyond the lesson . . . . . . . . . . . . . Lesson 3: Painting textures on surfaces . . . . . Introduction . . . . . . .
Using creation expressions to set Using runtime expressions . . . . Modifying runtime expressions . Beyond the lesson . . . . . . . . Chapter 13 a constant . . . . . . . . . . . . . . . . . . color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645 . 646 . 648 . 649 Scripting in Maya . . . . . . . . . . . . . . . . . . . . . . . . 651 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . Some basic concepts . . . . . . . . . . . . . . . . . . . . . .
Using the edit flag in Python . . . . . . . . . . . . . . . . . . . 711 Communicating between Python and MEL . . . . . . . . . . . . 713 Beyond the lesson . . . . . . . . . . . . . . . . . . . . . . . . . 715 Chapter 14 Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preparing for the lessons . . . . . . . . . . . . . . . . . . . . . . Lesson 1: Setting up an asset . . . . . . . . . . . . . . . . . . . .
Beyond the lesson . . . . . . . . . . . . . . . Lesson 2: Creating a dynamic non-hair simulation . Introduction . . . . . . . . . . . . . . . . . . Lesson setup . . . . . . . . . . . . . . . . . . Setting up the curtain scene . . . . . . . . . . Making the hair collide with another object . Assigning a Paint Effects brush to the hair . . Setting up constraints . . . . . . . . . . . . . Rendering the curtain scene . . . . . . . . . . Beyond the lesson . . . . . . . . . . . . . . . Chapter 16 Fluid . . . .
Chapter 17 Fur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829 Introduction . . . . . . . . . . . . . . . . . . . . . . Preparing for the lessons . . . . . . . . . . . . . . . . Lesson 1: Assigning a fur description . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . Lesson setup . . . . . . . . . . . . . . . . . . . Duplicating objects across an axis of symmetry . Renaming surfaces on a model . . . . . . . . . Assigning objects to a reference layer . . . . . .
Making the character wear the dress . . . . . . . Caching nCloth to speed up playback . . . . . . Adjusting the fit of the dress . . . . . . . . . . . . Defining the behavior of nCloth clothing . . . . Painting nCloth properties . . . . . . . . . . . . Open the second scene for the lesson . . . . . . . Setting the initial state . . . . . . . . . . . . . . . Constraining nCloth clothing . . . . . . . . . . . Improving the quality of the nCloth simulation . Smoothing nCloth clothing . . . . . . . . . . . .
Open the third scene for the lesson . Render your liquid simulation . . . . Assigning material shaders . . . . . . Rendering a simulated frame . . . . Beyond the lesson . . . . . . . . . . Chapter 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 970 . 971 . 972 . 974 . 976 Live . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 979 Introduction . . . . . . . . . . . . . . . . . . . .
xviii
Overview 1 Introduction Welcome to Autodesk® Maya®, one of the world’s leading software applications for 3D digital animation and visual effects. Maya provides a comprehensive suite of tools for your 3D content creation work ranging from modeling, animation, and dynamics through to painting and rendering to name but a few. With Maya, you can create and edit 3D models in a variety of modeling formats and animate your models using Maya’s suite of animation tools.
This section provides the following information: ■ About the Getting Started lessons–Information about the lessons, where to begin, and the order in which you should complete the lessons. ■ Before you begin–Prerequisite knowledge and skills you should possess before beginning the Getting Started with Maya lessons. ■ Installing Maya–Information on installing Maya. ■ Using the lesson files–How to access and use the lesson files for the Getting Started with Maya lessons.
We recommend that any new Maya user begin by completing the following: ■ Viewing the Essential Skills Movies that are available when you first start Maya. ■ Completing the Maya Basics lessons (Chapter 2) which introduce many fundamental concepts and skills related to the Maya user interface. The version of Getting Started with Maya within the Maya Help also contains Apple® QuickTime® movies for some of the lessons. To use the lessons from the Maya Help 1 In Maya, select Help > Tutorials.
Apple® Mac OS® X operating system with the recommended minimum memory and storage requirements. Maya requires a three button mouse to access its full functionality for menus, commands, and 3D viewing. For complete instructions on qualified hardware and operating systems, as well as installation and licensing of the Maya software, please refer to the Installation and Licensing manual that came with your Maya software or check the Maya Features and Specification link at http://www.autodesk.com/maya.
Using the lesson files Many of the Getting Started with Maya lessons have accompanying lesson files that were created for use with the lessons. These files are included in the GettingStarted directory that was installed with your Maya software and can be found in the following locations: (Windows XP and Vista, 32 and 64-bit) :\Program Files\Autodesk\Maya2010\GettingStarted (Mac OS X) /Applications/Autodesk/maya2010/GettingStarted (Linux 64-bit) /usr/autodesk/maya2010-x64/GettingStarted Before you
To play the Essential Skills Movies 1 In the Essential Skills Movies window, click the buttons to play a movie. Your computer launches the necessary multimedia player and your chosen movie begins to play. 2 Click your multimedia player’s controls to start, stop, and pause the movie. To close the Essential Skills Movies window or the multimedia player 1 To close the Essential Skills Movies window, click the close box in the upper right corner of the window.
Maya Help Your Maya software application comes installed with Maya technical documentation that assists you in learning the Maya software. The Maya Help is HTML-based, structured by module, fully searchable, and is displayed using your computer’s web browser. The Maya Help is topic based and displays the major functionality categories for Maya. The Maya Help can assist you in finding reference information about particular topics, how to perform specific tasks, and MELTM command references.
The navigation pane updates to display an alphabetic list at the top of the pane with the first index items listed. 3 Click an item/letter in the alphabetic list. The information related to that topic appears in the right pane. To use the Maya Help search 1 Select Help > Maya Help. The Maya Help appears in a separate window (depending on your user preferences). The Maya Search button appears at the top of the left navigation pane. 2 Click the Search button.
To use Popup Help ➤ Move your mouse cursor over an icon or button. The name or description of it appears in a popup window directly over it. To turn on the Popup Help if it does not appear 1 If you’re operating Maya on a Windows or Linux operating system: ■ Select Window > Settings/Preferences > Preferences. ■ In the Preferences window, click the Help category and set the Tooltips box to Enable in the Popup Help section so a check mark appears. ■ Click the Save button to close the Preferences window.
To use the Help Line ➤ Move your mouse cursor over an icon or button. The icon or button name and instructions about how to use that tool appear in the Help Line. Find Menu The Find Menu feature lets you find the location of a particular menu item. Find Menu works only on the main menu items. To find the location of a main menu item 1 Select Help > Find Menu. The Find a Menu Item window appears.
The Maya Web site The Maya Web site contains a wealth of resources related to your Maya software and many other related products and services. You can view the Maya Web site athttp://www.autodesk.com/maya using your web browser. Autodesk Training Autodesk provides a range of products and services to help you get the most from your Maya software. You can purchase additional self-paced learning materials or attend certified instructor led training courses at Autodesk sanctioned training facilities.
2 Rename your existing user preferences file to a different name; for example, myprefs. The prefs directory path is: Windows (Windows XP) \Documents and Settings\\My Documents\maya\ 2010\en_US\prefs (Windows XP 64bit) \Documents and Settings\\My Documents\maya\ 2010x64\en_US\prefs (Windows Vista) \Users\\Documents\maya\2010\en_US\prefs (Windows Vista 64-bit) \Users\\Documents\maya\2010-x64\en_US\prefs Mac OS X /Users//Library/Prefer ences/Autodesk/maya/e
Maya Basics 2 Introduction Critical to learning any software application is some initial understanding of the basic concepts: how that software’s world works and the fundamental skills you need to work in that world. If you have never used a three dimensional (3D) software application before, you may initially find Maya different compared to 2D applications. If you are wondering “where do I begin?”, this chapter is the best place to start.
This chapter covers some of the fundamental concepts and skills for Maya in four lessons: ■ Lesson 1 The Maya user interface: Introduction on page 15 ■ Lesson 2 Creating, manipulating, and viewing objects: Introduction on page 29 ■ Lesson 3 Viewing the Maya 3D scene: Introduction on page 42 ■ Lesson 4 Components and attributes: Introduction on page 60 Preparing for the lessons To ensure the lessons work as described: ■ Ensure Maya is installed and licensed on your computer.
Lesson 1: The Maya user interface Introduction Just as the driver of an automobile is familiar with the dashboard of their vehicle, it is important for you to become familiar with the Maya “dashboard.” The Maya user interface refers to everything that the Maya user sees and operates within Maya. The menus, icons, scene views, windows, and panels comprise the user interface.
■ From the Windows Start menu, select All Programs > Autodesk > Autodesk Maya 2010 > Maya 2010. To start Maya on Mac OS X ➤ Do one of the following: ■ Double-click the Maya icon on your desktop. ■ Click the Maya icon in the Dock. ■ From the Apple Finder menu, select Go > Applications and then browse for the Maya icon and double-click it to start Maya. To start Maya on Linux ➤ Do one of the following: ■ Double-click the Maya icon on your desktop. ■ In a shell window, type: maya.
The Maya workspace The Maya workspace is where you conduct most of your work within Maya. The workspace is the central window where your objects and most editor panels appear.
When you start Maya for the first time, the workspace displays by default in a perspective window, or panel. There are the other components of the default perspective view panel: ■ The panel is labeled persp at the bottom to indicate that you are viewing the Maya scene from a perspective camera view. ■ The panel has its own menu bar at the top left corner of the panel. These menus allow you to access tools and functions related to that specific panel.
In Maya, like many other 3D applications, the three dimensions are labeled as the X, Y, and Z axes. The origin is located at X, Y, Z position of 0, 0, 0. The grid also lies along the X, Z plane. We refer to this as a plane because you might visualize an imaginary, flat, two-dimensional square laying along this 3D position. Maya labels the X, Y, and Z axes with a color scheme: red for X, green for Y, and blue for Z.
Main Menu bar Tools and items are accessible from pull down menus located at the top of the user interface. In Maya, menus are grouped into menu sets. These menu sets are accessible from the Main Menu bar. The Main Menu bar appears at the top of the Maya interface directly below the Maya title bar and displays the chosen menu set. Each menu set corresponds to a module within Maya: Animation, Polygons, Surfaces, Rendering, and Dynamics. Modules are a method for grouping related features and tools.
The main menu changes to display the menu set for Polygons. Menu titles such as Select, Mesh, Edit Mesh, and so on, appear. For now, leave the menu set at Polygons. You will use this set in the next step. To create a primitive 3D object from the Polygons menu set 1 Select Create > Polygon Primitives > Interactive Creation and ensure that a check mark does not appear beside this item. For this lesson, you won’t use this option. 2 From the Main Menu Bar, select Create > Polygon Primitives > Cube >.
The second group of circled icons relate to the scene and are used to create, open, and save your Maya scenes. The third and fourth group of buttons are used to control how you can select objects and components of objects. You will learn more about selection of objects in later lessons. The fifth group of icons are used to control the Snap Mode for objects and components. You will begin to use these tools in a later lesson in this chapter.
To create an object using a tool from the Shelf 1 From the Shelf, select the Surfaces tab in order to view the tools located on that shelf. 2 Select Create > NURBS Primitives > Interactive Creation to ensure that a check mark does not appear beside the item. For this lesson, you won’t use this option 3 From the Shelf, select the NURBS sphere icon located at the left end by clicking on it.
In your scene view the wireframe outline of the cube you created earlier in the lesson has changed color to navy blue, and the sphere is displayed in a bright green color. The sphere is now the selected object and the cube is no longer selected. In Maya, when the object displays like this, we refer to it as being selected or active. Selection of objects and components is a way of indicating to Maya that this particular item is to be affected by the tool or action you will subsequently choose.
To hide or show the Channel Box 1 To hide the Channel Box, click the Show/Hide Channel Box icon from the right end of the Status line. The Channel Box disappears, and the perspective scene view expands slightly. With the Channel Box hidden, you have more working area in your scene view. 2 To show the Channel Box, click the Show/Hide Channel Box icon on the Status line. The Channel Box appears in the scene view.
(Windows XP and Vista, 32 or 64-bit) :\Program Files\Autodesk\Maya2010\GettingStarted (Mac OS X) /Applications/Autodesk/maya2010/GettingStarted (Linux 64-bit) /usr/autodesk/maya2010-x64/GettingStarted 2 Copy the GettingStarted folder. 3 Paste the GettingStarted folder in one of the following locations, depending on the operating system that you are using: (Windows XP, 32 or 64-bit) :\Documents and Settings\\My Documents\maya\pro jects (Windows Vista, 32 or 64-bit) :\Users\
To save your Maya scene 1 Select File > Save Scene. A file browser appears, listing the GettingStarted project directory where you can save your scene. If the GettingStarted directory does not appear, you need to copy the GettingStarted folder and set it as your Maya project. See Copying and setting the Maya project on page 25. 2 Within the GettingStarted directory, double-click the scenes folder to open it. 3 Type: Lesson1 in the file name text box. 4 Click Save.
Beyond the lesson In this lesson you began your orientation to Maya by learning: ■ How to start Maya on your computer. ■ The Maya workspace, and how it shows three dimensional space (X, Y, Z). ■ How Maya color-codes items and tools related to X, Y, Z. ■ The location of the main menus for the various modules within Maya. ■ How to create a three-dimensional object from the Polygons menu. ■ The location of the Status Line and how items are displayed as icons.
Lesson 2: Creating, manipulating, and viewing objects Introduction Using primitive objects to model 3D forms is a great place to continue learning about Maya. You can create many types of 3D objects using Maya and then move, scale, and rotate them to create more complex forms in your scene. In this lesson, you begin to construct a classic temple using the primitive object creation tools in Maya.
Creating a new scene You begin your temple project by creating a new empty scene. To create a new scene 1 Start Maya (if it is not already running). When Maya starts, it automatically creates a new scene. If Maya was previously running, follow steps 2 and 3. 2 From the main menu, select File > New Scene. Maya displays the following prompt. 3 Click No. Maya creates a new scene and delete everything that was in the previous scene.
■ Duplicate the primitive objects to create multiple copies of the original or create different variations from your original primitive object. In this section, you construct the base for the temple using a polygonal cylinder primitive. The octagonal shape is created by modifying the creation options for the cylinder tool before you create the object. If you did not modify the cylinder options you would create a round cylinder. To create a polygonal cylinder for the base 1 Select the Polygons menu set.
NOTE You were instructed to reset the option settings as a precaution in case they had been set differently. This is a good habit to practice when working with tool options to avoid getting a result that was different from what you expected. The Toolbox: Layout shortcuts The Toolbox is located on the left hand side of the Maya user interface.
The workspace changes to a four-view layout. The perspective view is located in the top right corner and the other views show the object from the top, front and side. The layout shortcuts have other options that you will learn later in this tutorial. It’s now possible to see the base from the side view, but it would be easier to determine the position of the base if the side view were enlarged to a full view.
The Toolbox: Transformation tools You need to move the base slightly upwards in the Y direction so it is positioned on the X, Z plane. To do this you use the Move transformation tool located in the Toolbox. The upper half of the Toolbox contains the tools for transforming objects (selection, move, rotate, scale) within Maya. When you move your mouse cursor over any transformation tool icon you see the name of the tool appear next to the mouse cursor.
To select the base primitive object in the scene view ➤ Do one of the following: ■ With your left mouse button, click the object’s wireframe outline in the scene view. ■ With your left mouse button, drag a bounding box around one corner or edge of the object’s wireframe. The object is selected when its wireframe outline color displays in a bright green color. If it is not selected, its display color is navy blue.
The base cylinder now needs to be rotated slightly so the front of the base is parallel to a grid line. Since each facet of the octagon represents 45 degrees of a circle, you need to rotate the object approximately half of that amount or 22.5 degrees. To use the Rotate Tool to adjust the position of the base 1 Display all four views by positioning the mouse cursor in the view and tapping the spacebar of your keyboard. The four view panel appears.
You are rotating the cylinder around its Y axis. You may be asking yourself the question “How do I know if I’ve rotated the base exactly 22.5 degrees?” You can check the accuracy of the rotation by viewing the Channel Box. Rotate Y should be close to 22.5 degrees. TIP You can undo and redo the last action you performed. Undo reverses the last action you performed on a selected object. It also reverses any action you performed from the Edit Menu. To undo an action select, Edit > Undo, Redo, Repeat.
To move and rotate the base using the Channel Box 1 With the base cylinder selected, view the Transformation attributes in the Channel Box. Specifically, view the values for Translate Y, and Rotate Y. 2 In the Channel Box, adjust the attribute values so they match the above image by clicking in the field and entering the correct numerical values. This accurately positions the base in your Maya scene. Maya named the cylinder primitive when it was first created.
Duplicating objects Duplicating an existing object is a useful way to make an exact copy of it without having to start over. When you duplicate an item the copy takes on the characteristics of the original. Using the Duplicate Tool you can additionally apply transformations to the copy (move, rotate, scale). Return to a four view layout to view what you’ve accomplished to this point. To change the panel layout to a four view layout ➤ From the Toolbox, click the Four View layout shortcut.
3 In the Duplicate Special Options window, select Edit > Reset Settings and then set the following options: ■ Translate: 0 1.0 0 ■ Rotate: 0 0 0 ■ Scale: 0.9 1.0 0.9 ■ Geometry Type: Copy ■ Group under: Parent 4 In the Duplicate Options window, click Duplicate Special. Maya creates a duplicate of the templeBase object that is scaled to 0.9 of the original in the X, Z axes, and is one unit above templeBase. As a result of the scale operation, the base for the temple now appears stepped.
If you do not see the GettingStarted project directory, you have not yet copied the GettingStarted folder and set it as your Maya project. For more information, see Copying and setting the Maya project on page 25. 2 Within the GettingStarted project directory, ensure that you are saving in the scenes sub-directory. 3 Type Lesson2Base in the file name text box. 4 Click Save.
■ Try using the ViewCube™ located in the upper-right corner of the active scene view to change the camera’s viewing angle in relation to the objects in the scene. ■ Practice moving, rotating, and scaling objects, and changing between the various scene views (single perspective, four view, single side, single top etc.) Lesson 3: Viewing the Maya 3D scene Introduction In the previous lesson you learned how to view your 3D scene by changing between single and four view layouts.
■ Use additional primitive objects and options. Camera tools In the lessons so far, when you looked at an object from the top, front, or side views you have been viewing the scene through an orthographic view. Orthographic views appear two-dimensional because the object is displayed using parallel projections of only two axes at a time. (Scooter images courtesy of The Art of Maya) When you view the scene through the perspective view, you are viewing the scene in a three-dimensional manner.
Dolly Tool The Dolly Tool gets its name from filmmaking where a camera, mounted on a wheeled tripod, is moved towards or away from the scene. In Maya, dollying allows you to view the items in your scene either close up or from further back. To dolly the perspective view 1 Enlarge the scene view to a single perspective view. 2 Do one of the following: ■ (Windows & Linux) Press the Alt key and drag the mouse to the right while holding down the right button on your mouse.
Tumble Tool The Tumble Tool allows you to tumble or rotate the camera’s view around a particular center of interest to achieve either a higher or lower vantage point, or a different side angle. To tumble the perspective view ➤ Press the Alt key (Windows & Linux) or the Option key (Mac OS X) and drag the mouse either left or right, or up or down, while holding down the left button on your mouse.
To track the perspective view ➤ Press the Alt key (Windows & Linux) or the Option key (Mac OS X) and drag the mouse in any direction, while holding down the middle button on your mouse. The Track Tool works for both orthographic and perspective views. NOTE Even though the objects appear to move across the screen when operating any of these camera tools, it is the viewing camera that is actually moved in relation to the scene, not the objects.
2 In the Polygon Cube Options window, select Edit > Reset Settings and then set the following options: ■ Width: 1.75 ■ Height: 0.6 ■ Depth: 1.75 Leave the other options at their default settings. NOTE If the Polygon Cube Options window does not appear, ensure that the Interactive Creation option for primitives is turned off by first selecting Create > Polygon Primitives > Interactive Creation so that a check mark does not appear beside this menu item.
2 In the Polygon Cylinder Options window, select Edit > Reset Settings and then set the following options: ■ Radius: 0.5 ■ Height: 6 ■ Axis divisions: 12 Leave the other options at their default settings 3 In the Polygon Cylinder Options window, click Create. Maya creates the cylinder primitive at the origin. 4 In side view, move the cylinder upwards (Y axis) so it rests on the top surface of columnPedestal. You can do this using the Move Tool or with the Channel Box.
■ Scale: 0.8 1.0 0.8 Leave the other options at their default settings. 3 In the Duplicate Special Options window, click Duplicate Special. Maya creates a duplicate of the columnPedestal object and moves and scales it based on the options you set. NOTE If you positioned the geometry for the column using the Transform Tools and your mouse, the Y translate values may be incorrect for your particular model. You may want to continue positioning the objects by visual reference using your mouse.
■ Number of Sections: 8 ■ Number of Spans: 4 Leave the other options at their default settings. 3 In the NURBS Sphere Options window, click Create. Maya creates a half-sphere primitive at the origin. The sphere needs to be rotated 90 degrees and then positioned on top of the pedestal. To rotate and position the sphere on the pedestal 1 In side view, rotate the sphere so that the dome part is pointing up.
4 In the Channel Box, rename the sphere columnBase. Viewing objects in shaded mode Up to this point, you have been viewing your objects in the default wireframe mode. In wireframe mode, objects appear transparent except for the simple wire outline that indicates their position and general shape. Maya provides several options for displaying objects in a shaded manner. Change the display of your scene so that the objects display as shaded objects.
Grouping objects When you need to move, scale or rotate multiple objects as one unit it is easier if they have been grouped together so that they transform as one unit. Many primitive objects in Maya are grouped objects. For example, the NURBS cube primitive is comprised of 6 flat squares or planes that have been grouped together as one unit. When the plane objects are grouped together they create a hierarchy.
The Hypergraph The Hypergraph is a window that shows how the nodes and their connections are organized in your scene. You view object hierarchies and dependencies in the Hypergraph. Use the Hypergraph to view what happens when you group an object. To view the Hypergraph 1 From the view menu, select Panels > Layouts > Two Panes Stacked. The scene view splits into two viewing panels - each has their own separate view menu. You will set these to view the scene in the upper view and the Hypergraph in the other.
Some nodes display with a line connecting them. This denotes that they are in a hierarchy and have a dependency structure based on how they were originally grouped. For the temple’s column objects, the hierarchy displays each of the named objects under a node labelled group1. Group1 is the parent node for this hierarchy of objects.
TIP Many of the tools and features in Maya can be accessed using keyboard shortcuts. In Maya, these shortcuts are called Hotkeys. Some Hotkeys are displayed directly beside the menu item, others are listed in the Hotkey Editor. For a complete listing of available hotkeys, go to Hotkey editor. 2 In the Hypergraph, select the Column at the top node so that Column becomes active in the scene view. 3 In the scene view, use the Move Tool to position Column at the front corner of the temple base as shown below.
in the same position as the original. The two objects are on top of each other. You need to move the column into position on the adjacent corner of the temple base. To move the duplicate column into position on the base 1 In the Hypergraph, ensure Column1 is selected by clicking on its top node so it becomes selected in the scene view. 2 In the scene view, use the Move Tool to position Column1 on the adjacent corner of the temple base as shown below. 3 From the Toolbox, click the Four View layout shortcut.
When you first start Maya, the default selection mode is set to Objects. This is useful for much of your selection work with Maya, with a few exceptions. When you want to select items that have been grouped, set the selection mode to Hierarchy. TIP If you set the selection mask, it will remain that way until you change it again. If an item won’t select for you in Maya, you should check the selection mask setting to see if it is set correctly.
To group the two columns 1 Ensure Column and Column1 are selected. 2 From the main menu, select Edit > Group > . 3 In the Group Options window, select Edit > Reset Settings. Set the following options: ■ Group Under: Parent 4 In the Group Options window, click Group. Maya groups the objects together in a hierarchy and the pivot point is positioned at the origin. (When the pivot point is relocated to the origin the Move Tool manipulator for the selected group appears at the origin.
Save your work Your temple is taking shape! Save your work before proceeding to the next lesson. To save your Maya scene 1 To save your Maya scene, select File > Save Scene As. 2 Type Lesson3Columns in the file browser area reserved for file names. 3 Click Save. Beyond the lesson In this lesson, you explored additional tools and skills within Maya as you continued with the construction of the classic temple.
■ Practice moving and rotating objects, and changing between the various scene views (single perspective, four view, single side, single top, and so on). ■ View objects in the Hypergraph so you can understand their relationships and hierarchy. Lesson 4: Components and attributes Introduction Working with components is an important part of the workflow when working in Maya. Components describe objects at a more detailed level.
To template the base and columns 1 In the side view, with the Selection Mask set to Hierarchy, select all the objects in your scene. 2 From the main menu, select Display > Object Display > Template. The selected objects become templated. For your classic temple, you need to create the entablature using a torus primitive. An entablature is a structure that lies horizontally upon the columns of a temple and supports the roof.
Components All objects in Maya have a transform and a shape node. Geometric shapes, like the primitives in this tutorial, have smaller parts called components. A few examples of components in Maya are control vertices, faces, and hulls. Components allow you to work with objects at a finer level and allow you to edit them in creative ways. In order to change the shape of the entablature beyond the basic scale transformations, you need to modify its component information.
The menu that pops up is a marking menu for quickly selecting operations relevant to the object where you right-click the mouse. In this case, the choices pertain to the display of the entablature’s components. A set of small blue squares appear on Entablature called control vertices. Control Vertices (CVs) describe the shape of an object based on their position in space. If you move any combination of these vertices, you change the shape of the object.
■ Number of Spans: 4 In the NURBS Sphere Options window, click Create. 3 Rename the half-sphere templeRoof. The roof needs to be rotated -90 degrees about the X axis and positioned on top of the entablature. To rotate and position the roof on the entablature 1 In side view, rotate the roof so that the dome part is pointing up. 2 Move the roof so it is positioned close to the top edge of Entablature.
3 In the scene view, drag a selection box around all the objects in the scene so that the templated objects are selected simultaneously. 4 From the main menu, select Display > Object Display > Untemplate. 5 On the Status Line, choose the Select by hierarchy: root button. The Attribute Editor The Attribute Editor provides information about the various nodes and attributes for the objects and materials in your scene.
3 Click the templeRoof tab to see its attributes. This tab is known as the transform node, because the most important attributes on this tab control templeRoof’s transformation. Every visible object in Maya has a transform node, including cameras and lights. 4 Click the templeRoofShape tab to see its attributes. This tab is called the shape node because the attributes establish the object’s geometric shape or physical properties when the object is first created.
Surface materials The color, shininess, and reflectivity attributes of an object are controlled by its surface material (sometimes referred to as a shader, or shading material). Material attributes relate to how the object simulates a natural reaction to light in Maya’s 3D computer world. Maya assigns a default shading material to all objects when they are first created. In this section, you learn how to assign a new material to your objects.
inventor of this shading algorithm) provide for high-quality specular highlights on surfaces. 5 In the Attribute Editor, rename the blinn1 shading material to templeShader. With a shading material assigned to all the objects, you need to edit the color attributes of the templeShader material. To edit the shading material’s attributes 1 In the Attribute Editor, click in the gray box to the right of the word Color. The Color Chooser appears.
2 Click inside the color wheel (hexagon) and drag the pointer to achieve a sand color. The exact color is unimportant for this lesson. As you adjust the color wheel indicator, the temple objects become the same color you select in the Chooser. 3 Click Accept to close the chooser. You will learn more about Maya’s shading and texturing capabilities in future lessons. 4 In the Attribute Editor menu, choose the Selected menu item, and select templeBase from the list.
To save your Maya scene 1 Select File > Save Scene As. 2 Type Lesson4Final in the file browser area reserved for file names, and then click Save. Beyond the lesson In this lesson, you completed the construction of the classic temple and learned how to: ■ Display objects in template mode. ■ Select objects at their component level using selection masks and the right mouse button. ■ Assign and edit shading materials for your objects in the scene.
Polygonal Modeling 3 Introduction In Maya, modeling refers to the process of creating virtual 3D surfaces for the characters and objects in the Maya scene. Surfaces are vital for creating a convincing 3D image. Modeling is a process requiring keen visual skills and mastery of the modeling tools. The more accurate you are when modeling your forms in terms of size, shape, detail, and proportion, the more convincing your final scene will be.
Polygon surfaces are a network of three-or-more sided flat surfaces called faces that get connected together to create a poly mesh. Polygon meshes are comprised of vertices, faces, and edges. The wireframe lines on the mesh represent the edges of each face. The regions bounded by the edges are faces. Where the edges intersect each other is the location of a point called a vertex. When a polygon mesh is rendered, its edges can be set to appear hard or smooth.
6 As you work through this lesson, remember to save your work frequently and increment the name of the file every so often (filename1, filename2, and so on). In this way you’ll have earlier versions of your work to return to should the need arise. 7 Make sure that Soft Selection is turned off by opening the Tool Settings Editor with the Select Tool active and unchecking the box marked Soft Select.
■ Create polygon faces by placing vertices ■ Scale and extrude faces on a polygon mesh ■ Move and rotate extruded polygonal meshes ■ Split vertices and subdivide polygonal faces ■ Combine separate meshes into one mesh ■ Bridge between meshes ■ Add faces to an existing mesh ■ Use Snap to Grid ■ Preview a smoothed high resolution version of a polygon mesh ■ Harden and soften polygon edges Setting modeling preferences Before you create your polygon model change some of the default settings
dot). In addition, when a face is selected in the scene, the entire face appears highlighted. 5 Click the Save button to close the settings window. 6 Turn off the Interactive Creation option for primitives: Select Create > Polygon Primitives > Interactive Creation (no check mark).
To load reference images into the front and side orthographic views 1 In the Toolbox, click the Four View shortcut from the Layout Shortcuts bar. The perspective view is located in the top right corner and the other views show your scene from the top, front, and side. 2 In the front view panel menu, select View > Image Plane > Import Image. 3 Select the image file named HelmetFront.jpg.
To modify the transparency of the reference images 1 In the front view panel menu, select View > Select Camera. The camera for the front orthographic view is selected. 2 Display the Channel Box by clicking the Show/Hide Channel Box icon on the Status Line. The Channel Box displays the keyable attributes for the Front orthographic camera. 3 In the Inputs section, click the ImagePlane1 name to display the attributes for the image plane. 4 Set the Alpha Gain attribute to a value of 0.25.
Creating a polygon primitive You’ll create the top portion of the helmet mesh from a cube primitive using the image planes as a reference. Primitive objects are one method for starting 3D meshes because they can be modified to create other forms. To create a cube primitive for the helmet mesh 1 Ensure you are working in the perspective view. 2 Select Create > Polygon Primitives > Cube > .
To smooth and subdivide the cube primitive 1 With the cube still selected in the scene view, select Mesh > Smooth > , and set the following options in the window that appears: ■ Add divisions: Exponentially ■ Division levels: 2 2 Click the Smooth button The cube primitive is smoothed and is rounded at its corners. The cube has also been subdivided into smaller faces. The polygon faces are still four-sided even though their shape and position have been modified by the smooth operation.
To rename the polygon mesh ➤ With the cube still selected, rename the cube primitive using the Channel Box from pCube1 to helmetmesh. Modeling in shaded mode Modeling a polygon mesh in shaded mode gives you a better sense of the 3D volume that the model occupies as well as how any surface details appear. You can control the shading of an object separately in each view.
The wireframe appears on the mesh as well as the shading (whether or not the mesh is selected). The opacity of the smooth shading in the side and front views prevents you from seeing the image planes behind the object. X-Ray display mode solves this problem by making the smooth shaded surface appear semitransparent.
After setting the shading for the objects in the various views, you may wish to adjust the Alpha Gain setting on your image planes to change their transparency. As you gain experience with Maya, you’ll develop your own personal preferences for modeling in wireframe or shaded mode and switching between the various shading modes. Model symmetry Whenever you model an object, you should take advantage of any symmetry that the form provides.
You now have half as many components in your model. When you near the completion point of the model, you will copy the finished half across the axis of symmetry to get the complete model. Selecting components by painting You can delete some of the faces that are not needed on the front and lower section of the helmet mesh using the Paint Selection Tool. This is useful when you need to select components that are in an irregular region and are not easily selected using the bounding box.
2 In the side view, right-click the helmet mesh and select Face from the marking menu that appears. 3 In the side view, paint select the faces that appear along the front and lower areas of the mesh (see image) by dragging the mouse over the faces. NOTE The Paint Selection Tool only selects components on the mesh that face towards the camera. 4 Press the delete key to delete the selected faces. 5 Tumble the perspective view to review your work so far.
To align edges on the helmet mesh 1 Right-click the mesh and select Edge from the marking menu that appears. Maya’s component selection mode is set to edges. 2 Double-click one edge in the edge-loop directly below the X axis. The edge loop is selected. 3 On the Status Line, turn on the Snap to Grids feature by clicking the icon. Snap to Grids lets you move selected components to the closest grid line or grid intersection point.
6 In the top view, click-drag the blue arrow on the Move Tool manipulator downwards a small distance. The edge loop immediately snaps to a lower grid line. It is not positioned at the location you want, but all of the edges in the loop you selected are now aligned to each other. 7 On the Status Line, turn off the Snap to Grids feature by clicking its icon.
To manually reposition the vertices on the rear of the helmet 1 Right-click the helmet and select Vertex from the marking menu that appears. 2 In the side view, select the pair of vertices at the rear lower edge (see image) by dragging a bounding box around them. 3 In the Toolbox, click the Move Tool. 4 In the side view, click-drag the blue arrow on the Move Tool manipulator towards the right until the vertices are repositioned so that your helmet matches the reference sketch on the image plane.
6 In the side view, select other pairs of vertices along the top and front of the helmet and move them in a similar fashion so they match the reference image. Do not reposition the vertices for the top of the face shield yet. TIP You can click in the center of the Move Tool manipulator to drag a vertex selection freely. Next, you’ll reposition the border edges that lie along the bottom edge of the mesh. You can select these edge types using the Select Border Edge Tool.
clicking the first and then the last edge on the loop as indicated in the image below. 2 Using the Move Tool, drag the selected edge loop downwards until the left hand vertex roughly matches the lower edge indicated in the reference sketch. 3 In the side view, select and reposition the remaining vertices individually on the edge loop using the Move Tool so they match the reference sketch.
To edit the border edges on the upper edge of the face shield 1 From the Select menu, choose Select Border Edge Tool. 2 In the side view, click the first border edge that will be used as the upper edge of the face shield, then click the last border edge (see image). The border edges in between are selected. 3 In the Toolbox, select the Rotate Tool by clicking its icon.
6 Reposition the pairs of vertices on the upper front of the helmet to match the reference sketch. At this point in the lesson, the outline of your helmet should roughly match the helmet in the side view reference image. If it doesn’t, review the earlier steps in this lesson and make any adjustments to your polygonal mesh as required. If you view your helmet in the front orthographic view, you’ll notice that the helmet shows a wider profile from this view than the reference sketch.
2 In the front view, select the vertices that extend beyond the outline of the helmet as shown in the reference sketch (see image). 3 In the front view, move these vertices to the left until they match the widest area of the helmet in the reference sketch (see image). When you view your helmet from the top orthographic view the region between the side and rear of the helmet appears a bit flat in relation to the other areas.
To examine the mesh using the perspective view 1 Enlarge the perspective view. 2 Dolly and tumble the perspective view while you closely examine the helmet mesh. As you examine the vertices along any particular edge loop, the vertices on the mesh should appear to cascade in a smooth gradual fashion to create the curvature of the mesh with no undesirable spikes or dips.
2 In the Toolbox, double-click the Move Tool to display the Move Settings editor. 3 In the Move Settings editor, in the Move section, turn on the Normal option. 4 In the perspective view, click the vertex you wish to reposition. The vertex highlights and the Move manipulator appears to indicate the three directions of movement that are possible in this mode.
5 Drag the N handle outwards or inwards depending on what’s required for that particular vertex. Dolly or tumble the view as required to examine the mesh after you’ve done this and make any modifications as necessary. 6 Repeat the above steps for any other protruding or receding vertices on the mesh until you are satisfied that the mesh appears smooth. 7 Before you proceed to the next section, double-click on the Move Tool and return the Move setting to the default World setting.
■ Limit points to: 6 These settings specify that a closed polygon face will be created once you have placed six vertices in the scene. 3 In the side view, place six points for the profile as it appears in cross section of the lower front region of the helmet (see image below). Ensure that you place the vertices in a counter-clockwise direction for this step. The new polygon face is created along the YZ plane (the axis of symmetry for the model).
The selection is converted to a face selection. TIP You can also press Ctrl + F11 or Ctrl + right-click on the selected object and choose To Faces > To Faces from the marking menu that appears. Extruding polygon components You can create new polygon components from existing ones using the Extrude feature (Edit Mesh > Extrude). When you extrude a polygon component (for example, a face, edge, or vertex), you create additional polygon components from the ones you selected.
5 Click the large circle that surrounds the manipulator to display the rotate manipulators and then drag the green circular manipulator to rotate the angle of the extrusion to match the angle in the reference sketch (see image) and then drag the arrow manipulator a second time to extrude a second section of mesh.
To delete unwanted faces on the extruded mesh 1 Tumble the perspective view until you can view the inside of the lower front region (see image below). 2 Select the faces that appear on the inside of the mesh you just extruded, including the faces on either end of the extrusion. These faces were required for creating the extruded portions of the lower region but are not needed beyond this point. 3 Press the Delete key to delete the selected faces.
bridge, you need to extrude more edges on the helmet mesh so that the number of edges match when you create the bridge. To extrude the bottom edges of the helmet mesh 1 In the perspective view, select the lower edges of the helmet mesh using Select > Select Border Edge Tool. 2 Select Edit Mesh > Extrude, then drag the blue arrow manipulator in a direction towards the inside of the helmet to create a row of edges that are perpendicular to the selected bottom edges.
To move vertices on the lower front region to match the reference sketch 1 In the perspective view, right-click on the helmet and select vertex mode to change the selection type to vertices.
Bridging between edges Next you’ll connect the lower front region to the helmet mesh. You can create meshes that bridge between one or more border edges of a mesh using the Bridge feature (Edit Mesh > Bridge). When using the bridge feature you must ensure that: ■ the edges to be bridged are in the same polygon mesh. That is, you must combine the two meshes into one using the Combine feature, before you perform the bridge.
inserting two edge loops across the mesh. Inserting two edge loops in this region of the mesh also divides the large faces so they better match the size of the other faces on the rest of the mesh. To insert edge loops on the side region of the helmet 1 Select Edit Mesh > Insert Edge Loop Tool > . The Insert Edge Loop Tool settings editor appears.
5 Press the q key to return to selection mode, and click anywhere off the mesh to unselect the edges. Now that you’ve inserted the necessary edges, you can proceed with creating the bridge. To bridge between the lower front and side region of the helmet 1 Choose Select > Select Border Edge Tool and then click the border edges on both the lower front as well as the side region of the mesh where you want the bridging mesh to be constructed. (You should have five edges selected on either side).
2 Select Edit Mesh > Bridge > . 3 In the Bridge Options window, set the Divisions to 0, then click the Bridge button to create the bridge. 4 Press the q key to return to select mode, and click anywhere off the mesh to unselect the edges. NOTE If your bridge appears to twist or cross over itself it indicates that the two meshes have their surface normals mismatched.
2 Select Edit Mesh > Append to Polygon Tool > . 3 In the Append to Polygon Tool settings window, set the following: ■ Keep new faces planar: Off If the planar option is on, the Append to Polygon Tool will not create a multi-sided polygon as the edges you’ll select do not form a planar region.
Ideally, all faces should be four-sided to match the other faces on the helmet mesh. In the next section, you'll split the n-gon vertically and horizontally into several smaller four-sided polygons using the Split Polygon Tool. Splitting polygon faces Earlier in the lesson you split the helmet mesh by inserting edge loops across the mesh. You can split localized areas of a mesh using the Split Polygon Tool. When using the tool you draw a line across the faces to indicate the location for the split.
3 Tumble the camera in the perspective view so you can view both the upper inner edges of the face shield as well as the lower inner edges. 4 Click-drag the top inner edge of the face shield to indicate the start of the split (see image below). Drag the mouse to position the vertex until it stops at the right side of the edge. 5 Click-drag on the lower inner edge of the helmet mesh to indicate the end of the split (see image). Drag the mouse to the right until the vertex stops at the right side of the edge.
To split the face shield horizontally 1 In the perspective view, with the Split Polygon Tool still active, click-drag the inner side edge (see image) to indicate the start location for the horizontal split. 2 In the side view, click-drag the front vertical border edge of the face shield (this border edge lies on the axis of symmetry) and release the mouse button at the mid-point along the edge where the vertex naturally snaps (as if a magnet were attracting it towards that location).
NOTE When you split across multiple faces at the same time you only need to click an edge to indicate the start point for the split and on a second edge to indicate the end point. The Split Polygon Tool automatically splits the edges in between. 4 Press the q key to quit the Split Polygon Tool. In the next steps you'll reposition some of the vertices along the horizontal split to make the face shield protrude outwards a small amount.
TIP Tumble the perspective view so you can see the relationship between the vertices as you move them outwards. 3 Reset the Move Tool's Move Settings to World before continuing to the next steps. To create the diagonal grill vents on the lower front of the helmet you’ll insert edges on the face, reposition some of the vertices, and then extrude some of the faces. To insert multiple edges for the diagonal grill vents 1 Select Edit Mesh > Insert Edge Loop Tool > .
4 Press the y key to complete the edge loop insertion 5 Click off the mesh to deselect the edges. 6 Press the q key to exit the tool and return to selection mode. To make the grill vents appear diagonally you’ll select the vertices on the right side and then slide them downwards using the Move Tool. To move vertices along an edge using the Move Tool 1 Right-click the helmet mesh and change the selection mode to Vertex. 2 Select the vertices on the right side of the grill feature (see image below).
6 Drag the red arrow on the Move manipulator downwards to move the vertices so that the shape of the faces for the grill are more diagonal (see image). NOTE Make sure you do not move the vertices so that the lowest vertex touches the corner vertices or you’ll create an edge that has zero length. 7 Click off the mesh to deselect the vertices. 8 Before proceeding to the next section, double-click the Move Tool and reset the tool settings by clicking the Reset Tool button.
3 Select Edit Mesh > Extrude. The Extrude manipulator appears. 4 Drag the blue arrow on the Extrude manipulator towards the helmet a short distance to create the two recessed vents for the grill. 5 Press the q key to quit the Extrude feature.
6 Shift-select the two side faces on the grill vents that lie on the axis of symmetry and delete them (see image below). These faces will not be required when you create the opposite half of the helmet. 7 Save your work before proceeding to the next section. Terminating edge loops When you inserted the edges for the grill vents the adjacent face was changed from four-sided to eight-sided as a result of the splitting that occurred along the shared edge.
To manually split the multi-sided polygon into three four-sided polygons 1 Select Edit Mesh > Split Polygon Tool. 2 In the perspective view, click-drag on the top side edge of the top grill vent. Drag your mouse so the vertex is positioned at the bottom of the edge (see image). 3 Click-drag on the top edge of the multi-sided polygon and slide the vertex to the right end of the edge (see image). 4 Press the y key to split the face.
6 Click-drag the bottom edge of the multi-sided polygon and slide the vertex to the right end of the edge (see image). 7 Press the y key to split the face. Your multi-sided face is now split into three four-sided faces, maintaining the overall quad topology on the helmet mesh. 8 Press the q key to exit the Split Polygon Tool. Deleting construction history Maya keeps track of the options, attribute settings, and transformations made to an object via its construction history.
As you near the completion of a model, these construction history nodes are not required. If your production work entails having another person texture or animate the model, you’ll want to delete these history nodes from the objects in your scene altogether so another user doesn’t accidentally change your work. Deleting the construction history is usually done only when a model is completed to a particular milestone stage and the next major phase of production with it needs to occur.
Mirror copying a mesh Once you’ve finalized one half of your polygon model (and deleted its construction history) you’ll want to create the opposite half by copying it across the axis of symmetry so you have the complete model. You can produce a mirrored copy of a polygon mesh using Mirror Geometry (Mesh > Mirror Geometry). Before copying one half across the axis of symmetry, you should check that all of the border edges lie along the axis of symmetry.
7 On the Status Line, turn off Snap to Grids. 8 Click off the mesh to unselect the vertices. To mirror copy the polygon mesh 1 Right-click the mesh, change the selection mode to Object, and then select the helmet mesh. 2 Select Mesh > Mirror Geometry > click the Mirror button. ■ Mirror Direction: -X ■ Merge with original: On ■ Merge vertices: On , set the following options, and then The mesh is copied along -X to create the opposite half of the model.
3 Save your work before proceeding to the next section. At this point, the low resolution version of the helmet model is complete. In the next section you’ll preview how the model appears at a higher resolution using the subdiv proxy feature. Working with a smoothed mesh Depending on the intended use of your polygonal model, you may want a low resolution version, a high resolution version, or both. In Maya, its easy to increase the resolution of a model using the Smooth feature (Mesh > Smooth).
To create a high resolution smoothed model using Subdiv Proxy 1 Right-click the mesh, change the selection mode to Object, and then select the helmet mesh. 2 Select Proxy > Subdiv Proxy > ■ Division Levels: 2 ■ Mirror Behavior: None ■ Subdiv Proxy Shader: Keep , and set the following: 3 Click the Smooth button. A higher resolution, smoothed copy of the helmet mesh is created in the same position as the original mesh.
5 Press the ‘ key (located to the left of the 1 key) to toggle the display between the low and high resolution versions. Toggling the display between the two versions is useful when you want to view one or the other. 6 Press the ~ key to toggle the display so that both are visible again. NOTE The Toggle Proxy Display (‘) and the Both Proxy and Subdiv Display (~) display items are also available from within the Proxy menu.
In this lesson, you’ll try both methods on your helmet mesh. To display hard and soft edges on a mesh 1 Right-click the low resolution mesh, set the selection type to Object Mode, and then select the helmet mesh. 2 Select Soft/Hard Edges. The wireframe mesh on the helmet updates to display both dashed and solid lines. The dashed lines indicate edges that are set to display as soft shaded. The solid lines indicate edges that are set to display as hard shaded.
To harden the edges surrounding the face shield 1 Right-click the low resolution mesh and set the selection mode to Edge. 2 Select the inner edges that surround the perimeter of the face shield (see image below). TIP You can quickly select the inner edges surrounding the perimeter of the face shield using the Select Edge Loop Tool. You may need to double-click in a couple of areas to complete the selection. 3 Select Normals > Harden Edge. The selected edges are hardened on the low resolution mesh.
Notice that the same edges on the smoothed high resolution version of the helmet are unchanged. For edges to display sharp on the smoothed version, you must turn on the Keep Hard Edge attribute. To turn on the Keep Hard Edge attribute 1 In the perspective view, select only the smoothed high resolution version of the helmet mesh. 2 In the Channel Box, in the Inputs section, click the listed proxy to display its attributes. 3 Set the Keep Hard Edge attribute to On.
To crease edges on the mesh 1 Select the lower outer edges on the face shield (see image). 2 Select Edit Mesh > Crease Tool. 3 In the scene view, press the middle mouse button then drag the mouse to the right to add a crease to the selected edges. A thick line appears on both the low resolution model and the high resolution version to indicate that a crease has been applied.
4 Save your work. NOTE You can toggle the creased edge display (thick lines) by selecting Crease Edges. Your model is now complete. Depending on your requirements you can delete the construction history on both the low resolution and high resolution versions. Refine any regions on the helmet as required to gain more experience with the tools presented in this lesson.
Hypergraph window (Window > Hypergraph: Hierarchy) and selecting Edit > Ungroup. Beyond the lesson In this lesson you learned some basic techniques of polygonal modeling: ■ You can create complex polygonal models with surprisingly few techniques. ■ Starting from a primitive surface such as a cube, you can smooth, scale, move, extrude, split, and rotate components of the primitive to create a low resolution version of the model you want to create.
■ You can also modify a polygon mesh using the Soft Modification Tool which lets you smoothly modify a group of vertices on a mesh. If you want to learn more about a particular tool or feature that has been presented in this lesson, refer to the Maya Help. Lesson 2: Sculpting a polygon mesh Introduction In this lesson you alter an existing polygonal head model into a goblin by sculpting the mesh with the transformation tools.
■ Select components using Marquee select and Drag select ■ Use Camera based selection to limit the components you select ■ Use the Split Edge Tool to separate edge rings Open the scene for the lesson In this lesson, you’ll work with a scene that we created for your use. The scene contains a human head. In the remainder of the lesson, you’ll alter this into a goblin head. To open the scene 1 Make sure you’ve done the steps in Preparing for the lesson on page 72. 2 Open the scene file named Poly_head.
4 Press the ‘b’ key. A circular colored area appears around the selected vertex. This colored area represents the falloff. Yellow represents areas of low falloff while black represents areas of high falloff. Areas with low falloff are affected more by transformations to selected components than areas of high falloff.
Next you need to adjust the Falloff radius. 5 Hold the b key and drag the left mouse button left or right. The falloff area grows and shrinks as you move the mouse. Adjust the size so that it encompasses as much of the nose as possible without touching the face. 6 Drag the z axis manipulator away from the face. As you drag the vertex away, the rest of the nose is smoothly stretched with it.
7 Select the Rotate Tool from the toolbox and, using the z axis manipulator, rotate the vertex down approximately 45 degrees. 8 Select the Move Tool again and drag the y axis (it appears yellow when selected and green when unselected) manipulator down. This creates a bend in the nose.
9 Turn off Soft Select by pressing the b key on your keyboard. Selecting with Camera based selection When selecting components on a model you often only want to select the components you can see and not the components behind them. You can use Camera based selection to limit your marquee select to only what the camera can see. To pull out the chin 1 Double-click the Select Tool icon in the toolbox. The Tool Settings editor appears.
4 While looking at the front of the head, select the five vertices on the same vertex loop at the front of the chin by holding the left mouse button at one corner of them dragging a marquee selection over them. Only the five vertices in the front are selected. 5 Turn on Soft Select by pressing the ‘b’ key on your keyboard. A colored falloff appears on the surface of the face.
Now you have a longer chin without affecting any of the geometry on the neck, which may have occurred accidentally if Camera based selection had been off. Sculpting with symmetry To give the head a more goblin-like appearance, you need to make the cheeks and eyebrows more boney. However, to do this, you need to adjust both cheeks equally. You can do this with the transformation tools’ Reflection settings. To modify both cheeks simultaneously 1 Double-click the Move Tool in the Toolbox.
4 With the camera positioned in front of the head, select a set of vertices on the left cheek. A colored falloff appears on both cheeks. 5 Pull the x axis manipulator to the left so that the cheeks are pulled closer together. Both cheeks are transformed identically and appear more boney.
Now you can adjust the eyebrows to make the goblin angrier. To rotate the eyebrows 1 Press the ‘b’ key on your keyboard to disable Soft Select. 2 Click the outermost vertex on the left eyebrow. 3 Shift + double-click the innermost vertex on the left eyebrow. All the vertices on the same loop are selected between and including the two vertices.
NOTE The selection of vertices on the other side of the reflection seam do not appear complete after this step. This is normal and is rectified in step 4. 4 Press the ‘b’ key on your keyboard to enable Soft Select. 5 Hold the ‘b’ key on your keyboard and drag the mouse left and right to adjust the Falloff radius so that it only affects the eyebrow. 6 Double-click the Rotate Tool from the Toolbox. The Tool Settings editor appears.
Sculpting with Surface based falloff The default setting in Maya uses a spherical volume to determine what components are contained in the Falloff radius. However, sometimes you need the Falloff radius to follow the contours of the surface. To do this, you must use Surface based falloff. To make the ears pointy 1 Double-click the Move Tool in the Toolbox. The Tool Settings editor appears. 2 In the Soft Selection section, set the Falloff mode to Surface.
6 Hold the ‘b’ key on your keyboard and drag the mouse left or right to adjust the Falloff radius so that it encompasses the top half of the ear. 7 Use the manipulators to pull the ear until it’s pointed. Surface based falloff ensures that only the ear is affected by your transformation. If you were using Volume based falloff, parts of the head would also be moved along with the ear.
8 Select the Scale Tool and scale the ears along the x axis so they become thinner. 9 Select the Move Tool again and pull the pointy end of the ears away from the head. Selecting with Drag select In addition to marquee selecting sets of components, you can also select them by dragging over them with the mouse. This is similar to the way that the Paint Selection Tool works. To make the eyes sockets more pronounced 1 Double-click the Select Tool in the Toolbox. The Tool Settings editor appears.
The vertices appear on the mesh. 5 On one side of the mesh, drag the mouse around the eye socket, beneath the eyebrow until you’ve covered a small area around the eye. You may find it easier to temporarily disable Soft Select to get a better view of what you are selecting. You can quickly toggle Soft Select on and off by pressing the ‘b’ key on your keyboard. 6 With Soft Select on, hold the ‘b’ key and drag the mouse to resize the falloff area so it covers only the eye sockets.
The eye sockets are pulled in so that both the eyebrow line, bridge of the nose, and cheeks are better accented. 8 Press the b key to turn Soft Select off. 9 Right-click the head and select Object Mode from the marking menu. 10 Select the two eyes and move them back along the z axis so they fit into the eye sockets again.
11 Set the selection mode back to Marquee. Adjusting the Seam tolerance You can use the seam tolerance to fatten the nose at the end. 1 Right-click the head and select Vertex from the marking menu. The vertices appear on the mesh. 2 Select a vertex on the left side of the tip of the nose. 3 Press the ‘b’ key to turn Soft Select on. 4 Hold the ‘b’ key and move the mouse left or right to resize the Falloff radius so it only encompasses the tip of the nose.
To unhide the hat ➤ Open the Channel Box and click the first empty box in the hat layer. Beyond the lesson In this lesson, you learned how to: ■ Activate Soft Select and adjust the Falloff radius. ■ Transform components with Soft Selection. ■ Use Camera based selection. ■ Select components using reflection. ■ Use both surface based and volume based falloff. ■ Use Drag select. ■ Adjust the Seam tolerance.
There are some additional Soft Selection options which are not described in this lesson: ■ You can change the shape of the falloff curve in the Soft Selection tool settings either by adjusting the Falloff curve graph or by selecting any of the Curve presets below it. You can also save a custom Falloff curve to the Curve presets. For more information, see Change the shape of the falloff area.
NURBS Modeling 4 Introduction NURBS (Non-Uniform Rational B-splines) use a method of mathematically describing curves and surfaces that are well suited to 3D applications. NURBS are characterized by the smooth organic forms they produce. NURBS surfaces can be quickly modeled and edited using a variety of techniques.
2 Make sure the Construction History icon (below the menu bar) is on: . (If it is turned off, it has a large X across it.) 3 If you have not already done so, copy the GettingStarted folder from its installation location to your projects directory. Then, set the GettingStarted directory as your Maya project. For more information, see Copying and setting the Maya project on page 25. 4 Select the Surfaces menu set.
In this lesson you learn how to: ■ Create a NURBS curve using the control vertices (CV) creation technique. ■ Use the grid for visual reference when modeling. ■ Determine the start and end points for a NURBS curve and its direction. ■ Create a revolved NURBS surface using the Revolve tool. ■ Change the display shading smoothness for a NURBS surface. ■ Edit a NURBS surface by editing its initial profile curve when it is linked to the surface by construction history.
4 In the front view, click the numbered positions as shown in the figure. Make sure the first and last positions are on the grid’s Y-axis (the thickest vertical line of the front view’s grid). Also, click three times in the same spot for positions 9, 10, and 11. This is necessary to create a sharp point or corner in the curve. To change the position of the most recent point clicked, you can middle-mouse drag it. 5 (Windows and Linux) After you click position 13, press Enter to complete the curve’s creation.
box at the first CV, visible as you create the curve. Curve direction is shown on the second CV after the start of the curve, indicated by a small u icon as you create the curve. Creating a revolve surface With the Revolve surface tool, a curve is rotated about an axis to create a surface. The user can define the axis of revolution. To create a revolve surface 1 With the curve selected, select Surfaces > Revolve. This creates the egg holder surface from the revolved profile curve.
useful for quickly examining the structure and components of a scene. The Outliner is also useful for selecting objects in situations like this. To edit a surface with construction history 1 Select In the main menu bar:. The Outliner appears and displays a list of the items in the scene. 2 In the Outliner, select the curve you revolved (curve1) by clicking on its name in the list. The curve becomes highlighted in the scene views.
5 If desired, save the scene for future review. 6 Close the Outliner window. Beyond the lesson In this lesson you were introduced to a few basic techniques related to NURBS modeling: ■ Revolving a curve is the easiest way to create surfaces with radially symmetrical forms— wheels, vases, glasses, pillars, and so on. ■ NURBS surfaces are webs of interconnected curves. The creation curves are used to create and subsequently modify the surfaces if required.
Lesson 2: Sculpting a NURBS surface Introduction In addition to creating NURBS surfaces using curves, you can edit and sculpt surfaces and primitive objects in Maya using the Sculpt Geometry Tool. The Sculpt Geometry Tool allows you to interactively push or pull on the surface regions to create areas that are embossed or in relief in relation to the surface.
Preparing a surface for sculpting Because a head is roughly spherical, you can create a primitive sphere as a quick starting point for creating a head and face. To prepare a sphere for sculpting 1 Make sure you’ve done the steps in Preparing for the lessons on page 149. 2 Select Create > NURBS Primitives > Sphere > .
NOTE In wireframe display mode, if you select Display > NURBS > Fine or Medium, more isoparms appear than there are actual spans and sections. The surface is visually displayed with extra precision, but the extra isoparms have no CVs and cannot be edited. 3 Name the sphere Egghead. 4 Rotate the sphere 90 degrees on its side (Rotate Z: 90). This positions the sphere’s CVs well for modeling a simple head and face. You’ll learn why later in this lesson.
Basic sculpting techniques In the next steps, you’ll become familiar with features of the Sculpt Geometry Tool. With this tool, you use your mouse or stylus to push, pull, or smooth a surface’s shape without selecting or displaying CVs. After you practice sculpting the surface, you’ll erase your practice strokes then begin sculpting Egghead’s features. To practice sculpting using basic sculpting operations 1 With Egghead selected, select Edit NURBS > Sculpt Geometry Tool > .
Unlike smoothing, Relax works by only averaging the largest surface anomalies so that the overall shape is maintained. ■ The Erase operation eliminates the effects of the other four operations. The Erase operation works up to the last time you saved the scene or clicked the Update button to the right of Erase Surface. 2 Experiment with each of the five operations on the surface. Don’t be concerned with the results. Just become familiar with the response to your mouse strokes.
The strokes alter the surface because the radius overlaps the CVs. As this example shows, you need to make sure the radius is big enough to influence the desired CVs. It’s common to change the radius many times during a sculpting session. If you prefer to affect a small region without increasing the radius, you can add CVs to the region by inserting more isoparms. You’ll do this later in the lesson. 6 Flood-erase the changes to the surface as you did previously.
8 Flood-erase the changes to the surface as you did previously. 9 Rotate the camera view so the X axis of the View Axis points toward you. Draw a vertical Pull stroke again. As your stroke nears the center of Egghead, a kink occurs. It’s challenging to alter a surface symmetrically in a region where many isoparms converge at a single point, called a pole. Always consider the position of isoparms as you sculpt a surface. In general, sculpt where isoparms are evenly, regularly distributed.
2 Draw a vertical Pull stroke. 3 Change the Max Displacement to 1. 4 Draw another vertical stroke nearby. The Max Displacement sets the maximum distance the surface’s CVs are pushed (or pulled) with a single stroke. 5 Erase the changes to the surface. 6 Set Max Displacement to 2. 7 Draw a vertical Pull stroke. 8 Set the Opacity from the default value of 1 to a value of 0.2. 9 Draw another vertical stroke nearby. One ridge is higher than the other. The Opacity value scales the influence of Max Displacement.
TIP Consider using an electronic tablet with pen stylus. A pen stylus is more natural for stroking surface changes as it feels like a pen. With a stylus, you can set an option that causes the Radius or Opacity to vary with stylus pressure. For example, you can have heavy strokes create a bigger Radius than light strokes. To do this, display the Stroke tab of the Sculpt Geometry Tool. For Stylus Pressure, select Opacity, Radius, or Both. Radius is a common choice.
To build up a small area, position the stroke icon there and click the mouse rather than drag. Tumble the view to examine your results after each stroke or click. If the strokes create a bumpy surface, turn on the Smooth operation and click Flood once or twice to smooth all strokes on the surface. Because Opacity is 0.2, the Smooth operation is subtle. Alternatively, you can smooth a selected region by stroking just that area. It’s common to smooth a surface regularly while using pull and push strokes.
NOTE If the Reflection setting does not push or pull in the same direction on either side of a NURBS surface you can adjust the Reference Vector to alter the direction of these operations. In the Sculpt Parameters section select UV Vector and turn on Enable UV Vector Adjustment. Click and drag the mouse left or right to adjust the direction of the U and V reference vectors. Sculpting eyebrows Eyebrows help define how stern or pleasant a face appears.
Sculpting a mouth With the 30 Sections and 30 Spans specified for the original sphere in this lesson, the large space between isoparms in the mouth region makes it impossible to create a subtle shape for the lips. To overcome this problem, you must insert isoparms in the mouth region before sculpting. To insert additional isoparms 1 Right-click Egghead and select Isoparm from the marking menu. 2 From the Toolbox, choose the Select Tool.
4 Select Edit NURBS > Insert Isoparms > . In the options window, turn on Between Selections, enter a value of 2 for # Isoparms to Insert, then click Insert. This inserts two extra isoparms between each pair of selected isoparms, for a total of four extra isoparms. This provides enough CVs to create subtlety in the mouth. You might want to add vertical isoparms at the lips in a similar way. The extra isoparms would also be useful if you were to later enhance the shape of the nose.
NOTE It might be easier to push or pull the lips with the Ref. Vector set to Z Axis. This moves the region you stroke in the world Z-Axis direction. The default Normal setting moves the region in a direction normal (perpendicular) to the surface. Because the normal direction on a lip might be up, down, or straight out, depending on the part of the lip you stroke, there’s more possibility of undesired results when you use the Normal setting.
■ To create simple, unadorned ears, you can create, scale, and squash a sphere. Create ridges and valleys by pulling CVs or by using the Sculpt Geometry Tool. Duplicate the ear by first setting its pivot point to the origin and with the Scale option set to -1, 1, 1. Parent the ears to Egghead. To import existing models into your scene: 1 If you saved the Eggholder scene in the prior lesson, you can import the egg holder into this Egghead scene, then position Egghead into the egg holder.
■ The density and orientation of isoparms on a surface affects the results with the Sculpt Geometry Tool. As you gain NURBS modeling experience, you’ll learn how to use the density and orientation of isoparms to your advantage. ■ Primitive objects are useful objects for sculpting in many cases. After you create a primitive, you typically sculpt, scale, trim, or otherwise alter the object into a more complex shape.
Another method for creating NURBS surfaces is to loft a series of curves that define the cross section of your desired surface form. Lofting a surface works like stretching a skin over each of the cross sections to create the final surface. In this lesson, you learn additional NURBS surfacing techniques by using the Loft tool to create the body of a salt shaker. You will also create the cap for the salt shaker by modifying the shape of a primitive sphere.
A circle is a curve that loops back on itself. The CVs work the same way as for any other curve. The more CVs you create for a curve or surface, the more detail you can give its shape. The drawback to using many CVs is that you’ll have a harder time making smooth shape changes to broad regions. Also, more CVs means slower processing time as you work with the curve. It’s best to make curves with as few CVs as necessary. With experience, you’ll learn how many CVs to use in a situation.
8 Turn off Snap to Points. Turn off the display of CVs for both circles by right-clicking on the circles and selecting Object Mode from the marking menu. Duplicating curves In the next steps, you’ll create several copies of the previously created circles (also called curves) to form the skeletal contours of the salt shaker’s surface. To duplicate curves for the lofted surface 1 Right-click the outer curve and choose Select from the marking menu. .
This creates four copies of the original curve, each translated three units above the last, and each scaled smaller than the last. 3 Select the inner circle and then move it to 0, 13, 0 by entering these translate values in the Channel Box. Increase its Scale attributes to 1.33, 1.33, 1.33.. 4 Use Edit > Duplicate Special > ■ Translate: 0 2 0 ■ Scale: 1.05 1 1.
2 Select Surfaces > Loft. This creates the salt shaker’s body. 3 Name the surface shakerBody. 4 Press 5 to display the view with smooth shading. NOTE Many of the surface creation tools also have the option of creating polygon or subdivision surface versions of a surface with the same input curves. You do this by setting the appropriate Output Geometry option for that particular surface tool.
4 Scale the cap size so that its diameter fits snugly at the top of the body. 5 Adjust the cap’s position as desired. 6 In a side view, make sure that the cap is displayed as a wireframe. 7 Right-click on the Cap and choose Control Vertex from the marking menu. 8 Select the top row of CVs and drag them down until the top of the cap is flattened: Check that the bottom half of the cap isn’t poking through the visible surface of the body. You can scale the bottom CVs inward to avoid this problem.
Using the Outliner to parent objects The Outliner is an editor that is useful for quickly examining the structure and components of a scene. You can use the Outliner to quickly parent objects to create an object hierarchy. To parent an object using the Outliner 1 From the main menu, select In the main menu bar:. The Outliner window is displayed. A list of the scene’s components is listed in the Outliner. 2 In the Outliner, click on the word Cap to select it.
By parenting the objects, you can move, rotate, or scale the cap and the body as a single entity by selecting only the body. Notice that the salt shaker displays horizontal curves that wrap around the body. The curves are the original circles you used to loft the surface. Because these curves are part of the surface’s construction history, you can alter their shape if you decide you want to alter the shape of the body and the body will update based on the construction history.
180
Subdivision Surfaces 5 Introduction Subdivision surfaces are a hybrid surface type that possess characteristics of both NURBS and polygonal surfaces as well as other features not offered by the other surface types. Like NURBS, subdivision surfaces are capable of producing smooth organic forms and can be shaped using relatively few control vertices. Like polygonal surfaces, subdivision surfaces let you extrude specific areas and create additional detail in your surfaces.
5 Select Window > Settings/Preferences > Preferences. 6 In the Preferences window, select Subdivs from the Categories list to display the subdivision surface preferences. 7 In the Subdivision Surfaces Component Display settings, set the Component display to Numbers, then click Save. Setting the subdivision components to display as numbers allows you to see the subdivision surface level directly on the surface.
■ Add more detail to subdivision surface models using Refine Selected Components. ■ Create a crease along a vertex edge. Creating a subdivision surface You begin the lesson by creating a polygonal cube. You’ll convert this cube to a subdivision surface that will be the foundation of the hand.
2 Press 3 on your keyboard (to select Display > Subdiv Surfaces > Fine). 3 Press 5 (to select Shading > Smooth Shade All). With the smoothness set to Fine, you can see that the conversion to a subdivision surface creates a rounded, smooth shape. By pressing 3, the subdivision surface is displayed more precisely in the scene view. This gives a closer approximation of what the surface will look like when you create a rendered image of the scene.
The wireframe cube looks the same as the original polygonal cube. The new cube is called a polyToSubd1 for the subdivision surface as a result of the conversion. Rename it LeftHand. You can use polygonal modeling tools to edit the shape of the polygonal proxy, which indirectly alters the shape of the subdivision surface. Unlike working with an actual polygonal object, your modifications result in perfectly smooth surface changes rather than faceted changes.
This splits the face into two faces. You’ll extrude the left face into a finger later. 4 Repeat the preceding two steps as necessary to split the face as follows: Notice how splitting the face into multiple faces alters the shape of the subdivision surface. The front part of the subdivision surface now resembles the proxy shape more. If you were to split the front face several more times, especially near the outer edges, the subdivision surface would sharpen and resemble the proxy shape even more.
Extruding polygon faces Next, you’ll extrude faces to create fingers for the hand. To extrude the polygon faces to create fingers 1 In a perspective view, right-click LeftHand and select Face from the marking menu. This lets you select faces. 2 Select the right-most face by dragging a selection box around the tiny box at its center. (The subsequent illustration shows which face to select.) 3 Select Edit Mesh > Extrude.
7 Similarly, extrude the ring, middle, and index fingers from the appropriate wide faces. Don’t extrude the three small faces that lie between the wide spaces. Leave them in position to allow for webbing between the fingers. NOTE Do not be concerned if the hand you create does not match the lesson’s illustrations. Your goal in this lesson is to learn the workflow of subdivision surfaces, not to perfect your modeling technique. Next, you extrude a thumb using similar techniques as you used for the fingers.
3 Extrude the middle face and drag it directly outward. 4 Click the surrounding blue circle and use the rotate manipulator to aim it in a direction appropriate for a thumb. 5 Extrude three times more to create each segment of the thumb. Use the extrusion manipulator to rotate, move, and scale each extrusion to create the desired shape of a thumb. Use the following figure as a guideline. Again, it’s unnecessary to match the illustration or create a realistic thumb for this lesson.
7 Make coarse adjustments to various parts of the hand by repositioning the vertices with the Move, Scale, and Rotate Tools. The Move Tool works on individual vertices or groups of vertices. Rotate and Scale works on two or more vertices. Undo any changes you don’t like using Ctrl-Z (Windows and Linux) or Control-z (Mac OS X). Try to create the approximate thickness, length, and curvature of a cartoon character’s hand and fingers. There’s no need for perfection. You’ll refine the fingers later.
3 Scale the four vertices that surround the hole and scale them inward to narrow the wrist region of the hand. Subdivision surface levels Next, you refine the shape of the fingers by working in Standard Mode. In Standard Mode, you can make edits to mesh vertices, edges, or faces at different levels of refinement, that are not possible in Polygon Proxy mode. The different levels of refinement are referred to as subdivision surface levels.
This displays 0s on the surface in the same positions as the vertices in Polygon Proxy mode. In fact, the 0s are vertices. The number 0 refers to the level of detail you are capable of editing. The 0 level is identical to the coarse control possible in Polygon Proxy mode by manipulating the vertices. You can move, rotate, and scale the 0s to alter the shape of the surface just as you did for vertices in Polygon Proxy mode. 5 Right-click the surface and select Display Level > 1.
there are fewer of them. It’s common to switch back and forth between levels repeatedly in a work session. The hand has level 2 vertices at various locations, for instance, at the webbing between the fingers. You can also work at that level of detail if desired (select Display Level > 2). Refining surface components By default, a subdivision surface displays up to three levels of detail (0, 1, and possibly 2). The 0 level is the least refined.
5 In the scene view, right-click LeftHand and select Vertex from the marking menu. This displays additional level 2 vertices in the fingertip region. 6 Select Modify > Transformation Tools > Move Tool, Rotate Tool, Scale Tool, Show Manipulator Tool > . In the Tool Settings window, turn on Normal, then close the window. You can thereafter use the Move Tool manipulator to move vertices in a direction normal (perpendicular) to the surface. 7 Select the vertices in the nail region.
Creating a crease in a subdivision surface One of the unique features of subdivision surfaces is that it’s easy to create a crease or ridge on a smooth surface. You’ll do this in the next steps. To crease the edge of the fingernail 1 Switch to Edge selection mode and shift-click the edges around the nail to select them. (It might be easier to see the desired edges by first selecting Shading > Wireframe.) 2 After you select the edges, select Subdiv Surfaces > Full Crease Edge/Vertex.
4 Now experiment on your own by moving individual vertices to shape the nail and surrounding region as desired. A few suggestions follow: ■ In Smooth Shade display mode (Shading > Smooth Shade All), certain vertices might be below the shaded surface and therefore impossible to select and move. To display and select such vertices, switch to wireframe shading (Shading > Wireframe).
window, click Reset Tool, and then close the window. This returns the Move Tool to its default settings. This will avoid confusion in future lessons. Beyond the lesson In this lesson, you were introduced to some basic techniques related to subdivision surface modeling: ■ Modeling with subdivision surfaces is an easy way to create intricate, smooth objects such as human hands and faces.
198
Animation 6 Introduction Maya lets you apply action to the objects in your 3D scene. In Maya, when an object or attribute changes in relation to time, it is referred to as being animated. Maya provides a large selection of tools to help you animate the objects in your scene. You may decide to use a combination of several techniques to achieve your desired results.
2 If you have not already done so, copy the GettingStarted folder from its installation location to your projects directory. Then, set the GettingStarted directory as your Maya project. For more information, see Copying and setting the Maya project on page 25. 3 Select the Animation menu set. Unless otherwise noted, the directions in this chapter for making menu selections assume you’ve already selected the Animation menu set.
■ Use the Time and Range slider and Playback Controls to control the playback. ■ Use keyboard shortcuts to set keyframes. ■ Use the Graph Editor to view animation curves. ■ Modify the animation of objects using the Graph Editor. ■ Set preferences to increase the playback quality. Setting the playback range In this lesson, you work with a scene we’ve created for your use. In the following steps, you open the scene and set how long the animation will play.
The Time Slider displays the playback range and keys you’ve set for a selected object. Keys are displayed as red lines. The box at the right of the Time Slider lets you set the current frame (time) of the animation. The Playback Controls control animation playback. You may recognize the conventional buttons for play and rewind (return to the start time). The stop button appears only when the animation is playing. To find out which operation a button represents, hold the mouse pointer over it.
This sets a key at frame 1 for all transform attributes of the ball. Transform attributes are the X, Y, Z move attributes. Although you animate only the translate X and Y attributes of the ball in this lesson, keying all transform attributes saves you time having to choose specific attributes to be keyed. In the Time Slider, notice the red marker at frame 1, known as a tick. This tick appeared when you set the key for frame 1. With the ball selected, ticks in the Time Slider indicate where you’ve set keys.
2 With the Move tool, drag the Y-axis handle of the ball until it sits slightly above the fence. TIP Throughout this lesson, tumble the perspective view or examine a front view to make sure the positioning is correct. 3 Set a key. (Press s.) 4 Play the animation. The ball now flies off the ground, over the fence, and back to the ground in a smooth arc between the keyed start, middle, and end positions. 5 Press the stop button to end the playback.
5 Move the ball up again, but not as high as its peak height above the fence. 6 Set a key. When you play the animation, the ball travels over the fence and bounces on the other side. If you have a fast computer, you might notice that the animation plays too fast. By default, Maya plays the animation as fast as it can be processed. Because this scene is simple, the animation might play faster than the default film rate (24 frames per second).
The Graph Editor displays several animation curves, one for each keyed attribute of the ball. The animatable attributes for the ball are listed in the left column. Specifically, it displays the attributes of the selected transform node of the ball. Each curve graphs how an attribute changes value during the animation. The column of numbers at the left represents attribute values that can be animated, while the row of numbers at the bottom represents time (frame) values.
The green curve represents Translate Y, while the red represents Translate X. The color of each curve matches its attribute name. This color scheme is consistent throughout Maya for X, Y, and Z (red, green, blue). If you’ve never used a graph editor before, the relationship between a curve’s shape and the animation it represents might be hard to understand. With experience, you’ll quickly recognize how curve shape affects animation.
■ Use the Graph Editor’s Tangents menu items to change the adjacent curvature. This is the operation you’ll use in the next step. 5 In the Graph Editor, select Tangents > Linear. This changes the curvature around the key point from rounded to cornered. Specifically, the setting you select specifies how the key point tangent handles lie at this key point. This affects the type of interpolation between key points. 6 Play the animation and you’ll see the ball bounce more sharply.
12 Select the right tangent handle and use the Move Tool to move it up a little. Do the same for the left tangent handle. Be careful not to select the key point. This sharpens the bounce to simulate the effect of gravity and elasticity. Changing the timing of an attribute The ball seems to move too slowly in its journey. In the following steps, you’ll use the Graph Editor to hasten its movement.
This scales the curves symmetrically towards frame 1. The animation of the ball now plays from frame 1 to 48 rather than 1 to 72. The ball traverses the scene in less time, which, of course, means it moves faster. If you had started your drag operation from the middle of the frame range, the scale operation would have pulled the curves toward the middle of the frame range. You can snap the keypoints to whole values to keep the keyframes on a consistent timing.
If you want your curves to match the shape of the curves in the above figure, here’s what you would need to do: To adjust the animation curves to match the above images 1 On the Translate X curve, delete the three key points between the two key points at the end. To delete keys, select the key points and press Delete. (The preceding figures show the curve after the points were deleted.) To delete the points, drag a selection box around them and press Delete.
4 On the Translate Y curve, select the left-most key point and move its right tangent handle up slightly. 5 At the key point where the bounce occurs on the Translate Y curve, move the left tangent handle up a bit. This raises the high part of the curve left of that key point, which makes the ball rise higher over the fence. 6 If you want to change the shape of Translate Y curve but lack adequate control with the existing key points, you can add a key point at the position of your choice.
When you remove redundant key points, the shape of the curve doesn’t change and you speed up Maya processing. Using Playblast to playback an animation When you play a scene, you see a rough approximation of the animation. The playback speed and quality is imprecise as compared to rendering each frame and playing the frames in sequence with a playback utility specifically designed for this purpose.
You can animate most any attribute in Maya, not just the Translate, Rotate, and Scale attributes of a surface. For example, you can animate the intensity of a light, the transparency of a surface, the rotation of a camera view, or the position of CVs. ■ Work with the Graph Editor to adjust the animation attributes animation curves directly. The Graph Editor is the best tool for editing keyed animation by reshaping animation curves.
Lesson 2: Set Driven Key Introduction With keyframe animation, you key an attribute value to a time in the Time Slider. You repeat this process with different values at different times to animate the object. When you must animate multiple objects or attributes that interrelate, setting keyframes can quickly become a complex task. Set Driven Key is a technique for driving one object’s or attribute’s animation from another attribute.
1 Make sure you’ve done the steps in Preparing for the lessons on page 199. 2 Create a new scene. 3 Go to the start frame. 4 Create a polygonal cube and name it Door. 5 Scale and position it roughly as shown in the previous figure. Have the bottom edge of the door lie roughly along the X-axis. 6 With the pointer in the perspective view, press 5 (for Shading > Smooth Shade All). 7 Create a small polygonal sphere and name it Ball. Scale and position it roughly as shown in the prior figure in the introduction.
2 Click translateY in the Driven list. This is the attribute to be driven by the ball’s movement. 3 Select the ball in the scene view. 4 In the Set Driven Key window, click the Load Driver button. The ball appears in the Driver list. 5 In the Set Driven Key window, click translateZ in the Driver list. This is the attribute that will drive the door’s movement. You can set a driven key only after you select an attribute in the Driver list and in the Driven list. 6 In the Set Driven Key window, click Key.
The Time Slider is not involved in a driven key relationship and displays no red markers for keys. 7 Move the ball to the door’s position and then move the door above the ball. 8 In the Set Driven Key window, click Key. This sets another driven key that links the current Translate Z value of the ball to the Translate Y value of the door. 9 Move the ball to the right of the door and then lower the door to its previous position as shown in the following figure. 10 In the Set Driven Key window, click Key.
Viewing the results in the Graph Editor In the next steps you’ll examine the animation curve resulting from the driven keys you’ve set. If you are unfamiliar with animation curves and the Graph Editor, see Lesson 1: Keyframes and the Graph Editor on page 200. To view the set driven key results in the Graph Editor 1 Select the door. To display the animation curve for a driven key in the Graph Editor, you must select the object containing the driven attribute, not the object containing the driving attribute.
techniques to animate the driving attributes. This indirectly animates the driven attribute. You may find the following notes helpful when using Set Driven Key: ■ You can set driven keys to control a driven attribute with multiple driving attributes. For instance, you can have a muscle bulge when an elbow rotates, and have the bulge increase when the wrist rotates. Lesson 3: Path animation Introduction Path animation allows you to animate an object along a path specified by a curve.
In this lesson, you make an aircraft follow a motion path so it appears to fly and bank while it changes trajectory. We provide a scene for your use in the lesson. In this lesson, you learn how to: ■ Set an object to animate along a motion path using a NURBS curve as the path. ■ Modify the timing and rotation of an object along a motion path. ■ Blend between keyframe and motion path animation. Open the scene for the lesson In this lesson, you work with a scene we created for your use.
Animating an object along a motion path To animate the aircraft along the path curve, first select the aircraft and the path curve and then set appropriate options for the motion path animation. In the options window, you need to set the required time range for the path animation. You also need to ensure that the aircraft is oriented facing towards the direction of travel. The Follow, Front, and Up axis option settings determine the aircraft’s orientation along the path.
The aircraft is repositioned to the start of the curve, and oriented towards the direction of travel. The Start and End Times set the time duration the aircraft travels along the path curve (240 - 60 = 180 frames). The start and end times are displayed at the ends of the curve. 5 Click play on the Timeslider playback controls to play back the animation. The aircraft travels along the path. Observe that it begins its motion at frame 60.
Changing the timing of an object along a motion path When you first assign an object to a motion path, by default, the object travels along the path at a constant speed. In this lesson, you want the aircraft to initially travel along the path slowly, accelerate, and then finally move more slowly when it nears the end of the motion path. You can change the rate of travel for the aircraft by keyframing attributes that affect where the aircraft is positioned on the curve at a given time.
By default, the parameterization of a path curve is set between zero and one. At frame 60, the aircraft is at the beginning of the curve where the parameterization value is zero. When the aircraft is at the end of the curve (frame 240) the parameterization value for the curve is one. When the aircraft is halfway through the path animation (frame 150), it is located along the curve at a UValue of 0.5.
5 Right-click on the selected name. A drop-down list appears. 6 From the drop-down list, choose Key Selected. A position marker appears on the path curve indicating that a key frame has been set. The position marker is useful for determining where the aircraft is at a given time. Position markers do not appear when you render the animation. Using Key Selected ensures that a keyframe is set only for the item selected and nothing else.
11 Click play on the Time Slider’s playback control to play back the animation. The motion of the aircraft is not smooth as it travels along the path. It initially moves forwards and backwards a bit at the beginning and end of the path. This indicates that some adjustment of the animation is required. You adjust the animation using the Graph Editor. To view the Graph Editor 1 From the main menu, select Window > Animation Editors > Graph Editor. The Graph Editor appears.
The animation curve updates so that the keys connect via straight lines. This eliminates the dips in the curve that caused the aircraft to travel backwards. Next, you modify the tangents for keys 120 and 180 so the aircraft accelerates and decelerates near those points on the path curve. 1 In the Graph Editor, shift-select only the two keys for frames 120 and 180. 2 In the Graph Editor menu, select Keys > Break Tangents.
7 Select the key for frame 180. 8 Select the handle to the left of the key. The handle highlights in blue. 9 Using the middle mouse button, drag the handle so the curve has a gentle curvature as it enters the key as shown below. Modifying this tangent for this key will cause the aircraft to decelerate smoothly near the end of its travel. The modified animation curve appears as shown below. 10 Close the Graph Editor. 11 Click play on the Time Slider’s playback control to play back the animation.
The backwards and forwards motion that previously occurred is corrected. The aircraft travels slowly towards the first bend in the path curve, then accelerates and travels at a constant speed around the curve until it nears the end of the path where it decelerates and then slowly moves towards the end of the curve. Rotating an object along a motion path As the aircraft travels along the motion path, its orientation remains the same throughout the animation.
■ Set the values for Front Twist in the Channel Box. ■ Select the Front Twist channel by clicking its name. Right-click on the selected name and choose Key Selected.
In the steps that follow, you keyframe the aircraft to rise vertically from the floor surface and then travel along the motion path by blending between the two animation types. To accomplish this, you do the following: ■ Move the motion path up above the ground plane. ■ Keyframe the aircraft so it rises vertically above the ground plane. ■ Blend between the keyframe and motion path animations. To move the motion path 1 In the scene view, select only the path curve.
5 Right-click on any of the highlighted names, and choose Key Selected from the drop down list that appears. Keys are set for the selected channels. Keyframing these channels establishes a blending connection that will be discussed in subsequent steps. 6 In the Channel Box, set the following: ■ Rotate Y: - 90 The aircraft is rotated 90 degrees from its motion path position. 7 Select the Rotate Y channel by clicking on its name so it becomes highlighted.
1 To set the remaining keyframes for the keyframe motion of the aircraft, use the table below as a guide, keeping in mind that you set the keyframes in the following order: ■ Set the frame in the Time Slider. ■ Set the Translate and Rotate values in the Channel Box. ■ Select only the channels for those values. Right-click on the selected name and choose Key Selected.
The animation stops because the motion path animation was shut off when the blend attribute was automatically created when you set the first keyframe. The blend attribute values are set to zero by default. When the blend values are set to zero, the keyframe animation has full influence on the object, and the path animation is shut off. When the blend values are set to one, the motion path has full influence on the object and the keyframing is shut off.
A key is set for the blend starting point for the aircraft. At frame 30 the two animation types will begin to blend together. 5 Set the Timeslider to frame 70. 6 In the Channel Box, set the following: ■ BlendAddDoubleLinear1: 1 ■ BlendMotionPath1: 1 7 Right-click on one of the names, and choose Key Selected from the drop down list that appears. A key is set for the blend ending point for the aircraft. At frame 70 the motion path animation will have full influence.
To edit the rotation interpolation type for blending 1 In the Channel Box, click on the pairBlend1 channel. 2 Scroll the Channel Box so you can view the Attributes for pairBlend1. 3 Set the Rot Interpolation setting to Quaternions by clicking on the Euler angles name with the left mouse button. 4 Click on the pairBlend2 channel. 5 Click on the Euler angles name in the Rot Interpolation attribute and choose Quaternions. 6 Click play on the Timeslider playback controls to play back the animation.
You have completed this lesson. Beyond the lesson In this lesson you learned how to: ■ Create a motion path animation using a NURBS curve as the motion path. When you draw your own curves remember that a curve has a defined start and an end point based on how you create it. If your object is initially positioned at the wrong end of the curve, you can reverse the direction of the curve by setting the Menu Set to Modeling and then selecting Edit Curves > Reverse Curve Direction.
Lesson 4: Nonlinear animation with Trax Introduction Nonlinear animation allows you to create and edit an animation sequence by arranging smaller animation sequences (known as clips) on a timeline. A clip is a time-independent sequence of animation that you create from an existing animation (keyframe animation, expressions, constraints, and motion capture data - except motion path animation).
■ Create clips from your animation sequences for use in the Trax Editor. ■ Use the Trax editor to position, modify, and arrange clips in order to create and modify animation sequences in the scene. ■ Scale clips to modify the timing of an animation sequence. ■ Trim clips to remove unwanted motion. ■ Cycle clips to create motion that repeats. ■ Use the Graph Editor to modify the animation of a clip. ■ Use the Trax Editor to work with motion capture data.
■ Playback End Time: 240 To work more efficiently with the scene and the Trax Editor, you need to set a panel layout. To set a panel layout for use with the Trax Editor ➤ From the perspective view’s menu, select Panels > Saved Layouts > Persp/Trax/Outliner. The panel layout updates to display the Perspective view, Outliner, and Trax Editor simultaneously. This allows you to easily work with these windows without having to open and close them repeatedly. Next, set the Outliner so it displays clips.
Creating clips with Trax A clip is a time-independent sequence of animation data for one or more animated attributes that you create from existing animation (keyframe animation, expressions, constraints, motion capture data, and so on). A clip is time independent, allowing you to position, scale, and cycle a clip independently of other animatable attributes or other clips. This means you can arrange the clips into a particular sequence, and then play it back to see the results.
5 Press s to set a keyframe. In the Channel Box, the channels display in a different color. The color change indicates that the channels now have animation applied to them. NOTE If you normally use the Auto Keyframe function, you must shut it off for this lesson. For more information see Auto Key in the Maya Help. 6 In the Time Slider, set the current time indicator to frame 240.
The aircraft travels from left to right in the front view. 2 Click stop on the Time Slider’s playback control. Now that you have keyframed an animation sequence and confirmed that it works, you can create an animation clip. To create an animation clip of the keyframe animation 1 In the Trax Editor menu, with the aircraft still selected, select Create > Animation Clip > . 2 In the Create Clip Options window, select Edit > Reset Settings, and then click on the Create Clip button.
A clip does not yet appear in the track area of Trax Editor because the character set associated with the clip (the aircraft) has not been loaded to display. 3 In the Trax menu, with the aircraft selected, click the Load Selected Characters icon. The clip appears as a blue rectangular box in a track in the Trax Editor. A track is an area in the Trax Editor to place and work with one or more non-overlapping clips in relation to the animation timeline.
■ Source In and Source Out indicates the range of frames from the original source clip. ■ Duration indicates the length (duration) of the original source clip in frames. ■ Clip Name...the name of the clip. A default clip name is assigned to the clip, unless you specify it from the Create Clip Options window when you first create the clip. ■ Scale indicates the scale percentage for the clip. The scale percentage is the multiplier on the length of the original clip.
For more information see Nonlinear animation components in Trax in the Maya Help. Now that you have created your first animation clip and renamed it using the Trax Editor, you need to create a few more clips by setting additional keys and creating clips of the sequences. You need to create separate clips of the aircraft taking off and landing. To create an animation clip of the aircraft taking off 1 In the scene view, select the aircraft.
The Trax Editor updates to create an additional track and places the new clip on the new track. The Outliner updates to list the new clip and source clip. 10 In the Trax Editor, double-click on the new clip and rename it to Aircraft_Rise. 11 Click play on the Time Slider’s playback control to play back the animation. The aircraft rises as it travels forward. 12 Click stop on the Time Slider’s playback control.
7 In the Channel Box, select the Translate Y name so it becomes highlighted. 8 Right-click on the name and choose Key Selected to set a keyframe for this position. 9 Click play on the Time Slider playback controls to play back the animation. The aircraft travels forward and then lands as it nears the end of its travel. 10 Click stop on the Time Slider’s playback control. 11 In the Trax Editor menu, with the aircraft selected, select Create > Animation Clip.
To change the position of a clip in a track 1 In the Trax Editor, move the mouse cursor over top of the Travel_Forward clip. When the mouse cursor is over top of a clip in the Trax Editor, the cursor icon changes to a pointer indicating that you can drag the clip to either side or up and down between tracks. 2 Click-drag the Travel_Forward clip horizontally to the right in its track until the Frame In reads 60 as shown below. 3 Click play on the Time Slider playback controls to play back the animation.
You also need to modify the Playback End Time because the animation timeline is longer as a result of repositioning the clips. 1 In the Time Slider, edit the Playback range as follows: ■ Playback End Time: 360 2 Click play on the Time Slider playback controls to play back the animation. The aircraft takes off vertically, then travels to the right, and then lands vertically once the Travel_Forward clip’s motion is complete.
The selected clip highlights in yellow. 2 From the Trax menu, select View > Graph Anim Curves. The Graph Editor appears. 3 In the Graph Editor, shift-select the two keys on the animation curve as shown below. 4 In the Graph Editor, select Tangents > Flat. The shape of the animation curve updates to a gentle S-shape.
Reusing clips within Trax You can save and reuse clips for future use. You can key specific types of motion or attribute effects, save them as clips, and reuse the clips for other characters. When you reuse a clip created for one character and apply it to another, the clip attributes must be mapped to correspond between the two characters. For more information, see Mapping animation between characters in the Maya Help. In this lesson, you work with clips created for this aircraft animation.
To place clips into a track from the Outliner 1 In the Outliner, using the middle mouse button drag the clip named Bank_LeftSource into the same track as the Rise and Lower clips. Ensure you drag into an open area on the track that the clip will fit into. 2 Position the Bank_Left clip on the track so its Frame In number matches the Frame Out number on the Aircraft_Rise clip, as shown below.
A new track appears in the Trax Editor and the clip is placed on the new track. The narrow blue box is the summary track for the character set (in this case the Aircraft) The summary track represents all of the clips under a character, subcharacter, or group. When you import a clip onto the summary area by dragging it from the Outliner or Visor, the Trax Editor creates a new track for the clip. 2 Click-drag the Shift_Left clip so it lies directly below the Bank_Left clip on the track above it.
6 Dolly and track the view so you can fully see the area the aircraft will travel within. 7 Click play on the Time Slider’s playback control to play back the animation. After the aircraft rises, it travels forwards as before but now it shifts sideways to the left while one wing tips downwards, and then shifts sideways to the right, while the opposite wing tips downwards. 8 Click stop on the Time Slider’s playback control.
The aircraft rises, tilts left and right, and then lowers, without moving forward. Because the other tracks have been shut off temporarily, the aircraft’s motion is controlled by only one track. 3 Click stop on the Time Slider’s playback control. 4 Click the Solo button again to enable all the tracks. The dimmed tracks become active again. Muting a track disables only the selected track so it does not play back.
In the next steps, you select the four clips you imported to Trax, and scale them together so they occur over the same time frame as the Travel_Forward clip. To scale multiple clips in the Trax Editor 1 In the Trax Editor, shift-click on the clips: Bank_Left, Bank_Right, Shift_Left1, and Shift_Right1. The clip manipulator appears. The clip manipulator appears as a white box that encompasses the four clips with handles (triangles) on either end and a circle handle in the center.
Open the second scene for the lesson In this second half of this lesson, you work with a second scene file that contains motion capture data applied to a skeleton. Motion capture data is produced by capturing the movement of a real human or animal and digitizing it so it can be applied to a 3D animation character. Motion capture data contains keyframe animation. Motion capture data is useful because it can capture the subtle nuances of motion and gesture that make a character’s actions appear life-like.
If your skeleton doesn’t appear as shown, you will need to increase the size of the skeleton’s joints. To resize the joints on the skeleton 1 From the main menu, select Display > Animation > Joint Size. The Joint Display Scale window appears. 2 Set the Joint Display Scale to 10. 3 Close the Joint Display Scale window. To preview the motion capture animation 1 Click play on the Time Slider playback controls to play back the animation.
3 In the persp view, select the skeleton by click-dragging a bounding box around the skeleton. The skeleton is highlighted. When the skeleton is selected, many red ticks appear in the Time Slider. The red ticks represent keyframes from the motion capture data. 4 In the Trax Editor menu, select Create > Animation Clip > . The Create Clip Options window appears.
cycled to make longer animation sequences. When you cycle a clip, the clip is extended in length with duplicate animation from the original clip over a defined interval of time. If you want to cycle a clip, you must first determine areas within the animation sequence where the clip repeats seamlessly.
■ Time Range: Start/End ■ Start Time: 6 ■ End Time: 45 ■ Click Create Clip Two clips appear in the Outliner named WalkCycle and WalkCycleSource. 6 In the Trax Editor, with the skeleton selected, click the Load Selected Characters icon. The clip named WalkCycle appears in a new track. Loading the Character displays any tracks associated with the character; in this case the WalkCycle clip. 7 In the Time Slider, set the current time indicator to frame 1.
9 Press stop on the playback controls to stop the playback and reset the current time indicator to frame 1. 10 In the Trax Editor, drag the clip to the left in its track until the Frame In number reads 1. This sets the clip to begin at frame 1 in the Time Slider. In the steps that follow, you cycle the clip to extend the animation so the skeleton repeats the two step motion and travels farther in the scene.
4 With the clip selected in the Trax Editor, open the Attribute Editor. Open the Channel Offsets menu and ensure that the WalkCycle clip’s root.scale and root.translate offset attributes are set to Relative and root.rotate offset attributes are set to Absolute. Setting the offset attributes for the clip to Relative ensures that each cycle begins at the position where the last sequence left off. This ensures that the skeleton doesn’t jump back to its start point after each cycle.
Redirecting the motion within a clip Motion capture data can be used in a variety of ways. You can redirect the motion of a character using the same motion capture data. The Redirect tool allows you to alter the original animation for a character by modifying its path or orientation at any time during its animation. The Redirect tool does this by offsetting the translation and rotation attributes for the selected character.
3 In the main menu, select Character > Redirect > . 4 In the Character Redirection Options Window set the Redirection Type to Rotation only and then click the Redirect button. A Rotation redirection control appears between the hips of the skeleton, where the root joint for the skeleton’s hierarchy is. You want the skeleton to pivot (rotate) while standing on the ball of its right foot. To do this, you need to move the redirection control to the ball of the right foot of the skeleton.
The redirection control is now positioned to redirect the skeleton’s walking motion. To complete the redirection process, you need to set keyframes while setting the redirection control so the redirection of the skeleton can occur. To keyframe the redirection control 1 With the redirection control selected, press s to set a keyframe. A red tick appears in the Time Slider at frame 36 indicating the keyframe. Setting a keyframe establishes the starting rotation for the redirection rotation of the skeleton.
5 With the redirection control still selected, press s to set a keyframe. Setting a second keyframe establishes when the redirection rotation for the skeleton ends. 6 Set the current time indicator to frame 1. 7 Click anywhere in the perspective view to deselect any items in the scene. 8 Click play on the Time Slider playback controls to play back the clip.
NOTE When redirecting motion within Trax, you may want to consider creating a clip that contains the redirection animation to make it possible to reposition the redirect animation as a clip. Now that you’ve redirected the character to a different direction of travel during the walk cycle, you can reuse some of the motion from the original source clip you created earlier in the lesson and saved to the Outliner/Visor. You insert the source clip from the clip Library in Trax.
6 In the Trax tool bar, click the Trim Clip Before Current Time icon to trim the section of the clip that occurs before frame 98. The WalkSit clip is trimmed and the portion of the clip before frame 98 is discarded. 7 Click the Mute button again for the track containing the WalkCycle clip to reactivate the track. The dimmed track becomes active again. The skeleton however has updated to an incorrect pose near its previous position.
11 Press stop on the playback controls to stop the playback and reset the current time indicator to frame 1. A small jump cut occurs during the transition between the two clips. The jump cut occurs because the poses for the skeleton do not match from the end of the first clip and the beginning of the second. In your own work, try to anticipate how motion will blend between clips when working in Trax. You can correct the jump cut in this particular example by extending the WalkCycle clip.
4 Click play on the Time Slider’s playback control to play back the animation. The jump cut is less noticeable than before. 5 Press stop on the Time Slider’s playback control. You have completed this lesson. Before leaving this lesson, reset the joint size back to its default setting. To reset the joint size 1 From the main menu, select Display > Animation. The Joint Display Scale window appears. 2 Set the Joint Display Scale to 1. 3 Close the Joint Display Scale window.
When you create a clip, a character set is created if one does not already exist. You can load and work with multiple character sets in the Trax Editor. To select different character sets when working in Trax you can use the Select Current Character drop-down menu. Clips can also be arranged, scaled, and moved as groups. For more information see Move clips and Track view area in the Maya Help.
situations, a blend can be used to correct jump cuts. For more information see Create and edit blends in the Maya Help. Key into clip You can set keyframes to alter the animation within a clip. This process is called Keying into a clip. When you key into a clip, keyframes are placed at the current time on all the animation curves in the selected clip. For more information see Key into a clip in the Maya Help.
Lesson 5: Inverse kinematics Introduction Inverse Kinematics (IK) allows you to efficiently pose your models and characters for animation. You pose the skeleton by positioning IK handles, usually located at the end of an IK joint chain (for example at the hand). The rotations for the other joints are calculated automatically by an IK solver. An IK solver calculates the rotations of each joint back up the hierarchy of the joint chain based on the position of the IK handle.
of the model and IK is required so that it can be posed and keyframed to provide a convincing animation. In this lesson you learn how to: ■ Create and use hierarchies to define logical relationships between animatable objects. ■ Combine the components of a 3D mechanical arm model into a hierarchical grouping. ■ Construct a skeleton for use with IK. ■ Combine the skeleton with the mechanical arm model by parenting the components into a hierarchy.
■ A base for the arm to swivel about ■ A four-legged base for the assembly To work with this model using IK you must create a hierarchy for it. Understanding hierarchies Inverse Kinematics relies on hierarchical relationships between the components of a model and the IK system to pose and animate the components. Before using Inverse Kinematics it is important to understand hierarchies in Maya. A hierarchy is composed of a series of nodes that are combined for some purposeful relationship.
need to select and move the parent node of the hierarchy and the rest of the model (child nodes) also moves. Regardless of whether you decide to animate the mechanical arm using FK or IK, or a combination of both methods on the same model, the best approach involves making the mechanical arm model into a hierarchical structure. Creating a hierarchy for the mechanical arm ensures that: ■ Components of the hierarchy can be rotated as if they were one unit.
3 In the Hypergraph menu, select Graph > Scene Hierarchy. If the menu item appears dimmed, it indicates that the Hypergraph is already displaying the scene hierarchy The Hypergraph displays with a black background by default. In order to see the relationships between the items, the background has been modified for the images in this lesson. 4 In the Hypergraph menu, select View > Frame All to see all the components of your scene. The boxes represent the nodes for the various items in the scene.
Hierarchies combine the various objects into discrete components for the mechanical arm, such as the base, lower arm, middle arm, and upper arm. If you select and rotate any of the parent nodes in the hierarchies, none of the other arm components follow because they are not combined into one unified hierarchy. Creating a skeleton hierarchy To link the various components of the mechanical arm into a hierarchy that can be posed, you need to create a skeleton.
Skeletons are integral to the animation of any character or hierarchical model. Examples of characters that use skeletons are two and four legged animals. Skeletons are also useful for animating other organic components such as the tail of an animal, a tentacle of an octopus, or a snake. In the following steps, you create a simple skeleton consisting of four joints that you combine with the mechanical arm model into a skeleton hierarchy, allowing you to pose and animate the model.
4 From the main menu, select Skeleton > Joint Tool > . The Tool Settings window for the Joint Tool appears. The Joint Tool is used to create the joints and bones for a skeleton. 5 In the Joint Tool settings window, do the following: ■ Click Reset Tool to set the tool to its default settings. ■ Hide the Tool Settings window by clicking the right-pointing arrow that is located in the upper left corner of the Tool Settings window.
7 In the Hypergraph, dolly the view to see the skeleton node hierarchy you just created. (It appears at the right side of the view.) 8 In the Hypergraph, select the joint1 node. The entire skeleton becomes selected. Any rotations on this node also affect anything lower down the hierarchy. 9 Select joint2 (You can also press the down arrow on your keyboard to select further down the hierarchy). The skeleton is selected from joint2 downwards in the hierarchy.
Once a skeletal hierarchy is created, the various surface components can be added to the hierarchy. Parenting a model into a skeleton hierarchy Parenting is the term used when placing a node beneath another in a hierarchy so it becomes the child of the node above it (its parent) in the hierarchy. In the following steps, you add the surfaces of the mechanical arm model into the skeleton hierarchy.
4 Repeat the parenting process for the following items: ■ pin3 is parented under joint3 ■ pin2 is parented under joint2 ■ pin1 is parented under joint1 Your new hierarchy should appear as shown in the diagram below. In the next steps, SwivelBase becomes the parent node for the new hierarchy so that the entire arm assembly swivels about the center of the base component. 5 In the Hypergraph, select the node named joint1 and then shift-select the node named SwivelBase.
9 In the Hypergraph, select the node named Swivel_base. In the side view, observe that both the mechanical arm model and the skeleton are selected. Swivel_base is the parent or root node for the hierarchy. If you rotate SwivelBase, everything else below that node (the entire arm with skeleton) rotates. 10 Select the node named joint3. Observe that the last two components of the mechanical arm are selected. If you rotate joint3, only the components below that node in the hierarchy will be affected.
efficient to use Inverse Kinematics to pose the skeleton. For more information on forward and inverse kinematics, see Posing skeletons in the Maya Help. NOTE It’s not a simple matter to state that one technique or another is the only approach to achieving a desired result when animating in Maya. You must decide whether a particular technique works for a particular scenario based on the options it provides. A combination of animation techniques can be creatively used in a variety of ways.
■ Hide the Tool Settings window by clicking the right-pointing arrow that is located in the upper left corner of the Tool Settings window. The ikSCsolver setting selects the IK Single Chain Solver. This solver ensures that the joints in the skeleton will lie along a single plane. This solver is well suited for the mechanical arm, because the arm doesn’t need to twist, unlike a real arm.
5 In the Hypergraph, select the node named ikHandle1. The IK Handle (in combination with the end effector) is used by the IK solver to calculate the rotation of the joints in the IK chain. By default, the IK Handle is located at the last joint of the IK chain in the scene view. 6 Select the Move Tool from the Toolbox, and drag the Move Tool’s Z axis manipulator (blue arrow) to reposition the mechanical arm. When you drag the manipulator, the skeleton and mechanical arm model are repositioned.
You create a control object to select and manipulate an IK system instead of directly using the IK Handle. You can create a control object with a curve or a locator, which are often used because they don’t appear in the rendered image. The control object controls the movement of the IK Handle using a constraint. You can constrain the position, orientation, or scale of an object to other objects using constraints. To create a control object: ■ Create and position the control object in the scene view.
To rename the control object using the Hypergraph 1 In the Hypergraph, right-click the node named locator1. Choose Rename from the pop-up menu that appears. The locator1 name is highlighted on the node. 2 Type the name ArmControl and press Enter to save the name for the locator. Before you constrain the IK handle to the control object, you need to freeze the transformations for the control object. Freeze Transformations zeros the transformations for an object without changing the position of the object.
To easily identify the locator as the control object in the scene view, label the control object using an annotation. An annotation is a text label that can be set to point at the labeled item. Annotations are useful because they always face the viewer, regardless of the orientation of the model in the scene view. To label the control object in the scene view 1 In the Hypergraph, select the ArmControl node. 2 In the main menu, select Create > Annotation. A input window appears.
To simplify the display of the Arm Control node ➤ In the Hypergraph, right-click the ArmControl node. Choose Collapse from the pop-up menu. (You can also double-click a node to collapse or expand the hierarchy below it.) The ArmControl node appears as a single node instead of the previous three node hierarchy. The small arrowhead on the lower left-hand corner of the node indicates that the node is collapsed. The control object must be linked to the IK Handle to control the IK Handle.
The IK handle is constrained to the control object. In the Hypergraph, a constraint node is created beneath the ikHandle1 node. 4 In the Hypergraph, select only the ArmControl node. 5 In the Toolbox, select the Move Tool. 6 In the side view, drag the manipulator to reposition the control object. (Experiment with a few different positions in the side view only.) When you drag the manipulator, the control object moves, which in turn moves the IKHandle.
You make CargoMagnet point downwards using an orient constraint. An orient constraint constrains the orientation (rotation) of the X, Y, and Z axes of one object to match those of the constraining (target) object. In the next steps, you reset the position of the mechanical arm to its default position, and then apply an orient constraint to the last joint in the IK system so that its orientation matches the control object.
2 In the Hypergraph, select ArmControl and then shift-select the node named joint4. (You may need to dolly and track the Hypergraph view to view these nodes.) 3 In the Main Menu bar, select Constrain > Orient > . 4 In the Orient Constraint Options window, do the following: ■ Select Edit > Reset Settings to set the tool to the default settings. ■ Click the Add button. Joint4 is constrained to have the same orientation as the control object.
Limiting the range of motion of an IK system It’s possible to move ArmControl so that the mechanical arm fully extends to a straight position or orients itself to other positions that you don’t necessarily want. You can limit the range of motion of the arm to ensure that the IK system poses in a predictable manner. In the following section, you limit the motion for the IK system as follows: ■ Lock the translation of the control object (ArmControl) so that it can only move in Y and Z.
The numerical field for Translate X is dimmed indicating that the channel is locked. If you try to move ArmControl in X, it will not be possible unless you unlock the Translate X channel. To lock the Rotate X and Z channels for SwivelBase 1 In the Hypergraph, select only the SwivelBase node. 2 Open the Channel Box to view the rotation channels for SwivelBase. 3 Set all Translate or Rotate channels to 0, if they are not already.
SwivelBase rotates in the view but the mechanical arm does not rotate. You first might think something is wrong because SwivelBase and all of the arm’s skeletons and surfaces are parented into the same hierarchy. NOTE You may sometimes discover that something doesn’t work in the manner you originally anticipated when setting up an IK system. When this occurs, it’s useful to stop and diagnose why something is working the way it is (or not working the way it should).
The order of selection is important. You want to shift-select the items that will be the child nodes first, and then shift-select the item that will be the parent node last. 6 In the main menu, select Edit > Parent (Hotkey p). In the Hypergraph, IKHandle and ArmControl are now child nodes for the SwivelBase node in the skeleton hierarchy. 7 In the Hypergraph, select only SwivelBase. 8 Using the Channel Box, set Rotate Y for SwivelBase to 45.
To determine translation limits for the Arm Control 1 In the Hypergraph, select ArmControl. 2 Ensure the Channel Box is open so you can view the translate channels for ArmControl. 3 In the view, select Panels > Orthographic > side. 4 Dolly the side view so you can fully view the mechanical arm. 5 Select the Move Tool. 6 In the side view, press the middle mouse button and drag the mouse diagonally until the mechanical arm is fully extended as shown below.
9 In the Channel Box, observe the numbers that display in the Translate Y and Z channels. When the arm is articulated to a compressed pose, the translation values are roughly as follows: ■ Translate Y: -13 ■ Translate Z: -13 These minimum and maximum values will be used in the steps that follow as the minimum and maximum translation limits for the ArmControl. To set translation limits for the Arm Control 1 In the Hypergraph, select the ArmControl node.
5 In the Translate attributes, click the Trans Limit Y and Z check boxes to undim the numerical boxes and then set the following values: ■ Trans Limit Y (Min): -13 ■ Trans Limit Y (Max): 7.5 ■ Trans Limit Z (Min): -13 ■ Trans Limit Z (Max): 1 6 Hide the Attribute Editor. 7 Select ArmControl. 8 In the side view, move ArmControl to test the range of movement for the IK system. The mechanical arm moves with a limited range of motion.
The child nodes below joint1 disappear, simplifying the display of the hierarchy. The small arrowhead on the corner of the joint1 node indicates that a hierarchy exists below joint1. If you later need to view or select these nodes you can expand them again. 2 Collapse the ArmControl and IKHandle nodes. The display of the hierarchy is simplified as shown below. The IK system is now rigged and ready for animation.
4 In the Channel Box, set the Translate Y and Z values as follows: ■ Translate Y: -9 ■ Translate Z: 0 The arm is repositioned so that the cargo magnet is directly above the cargo box as shown below. Track, tumble, or dolly the view if required so you can see the mechanical arm unobstructed. 1 In the Hypergraph, with ArmControl still selected, shift-select the CargoBox node. The order of selection is important when you apply constraints.
5 In the Channel Box, set the Rotate Y value for SwivelBase as follows: ■ Rotate Y: -100 The mechanical arm and the cargo box are positioned as shown below. 6 In the Hypergraph, select Platform and then shift-select the CargoBox node. 7 In the main menu, select Constrain > Parent. CargoBox is constrained to Platform. This is the second constraint for the CargoBox. 8 In the Hypergraph, select only CargoBox. 9 In the Channel Box, view the parent constraints for CargoBox.
to a value of 1. If you move the mechanical arm, the cargo box will move somewhere between its first and second position. This occurs because each constraint has equal influence on the cargo box at this point. Before you can animate the objects in the scene, you also need to reset the default weight values for each constraint, so that one parent constraint has full influence on CargoBox when the other does not. To set the weighting for the parent constraints 1 In the Hypergraph, select only CargoBox.
Planning the action usually involves sketching a simple storyboard, and writing out a brief timeline for the action for each component. In this lesson we’ve provided a simple version for you. The basic premise for the action is as follows: ■ The cargo box is positioned directly in front of the mechanical arm. ■ The mechanical arm extends, and positions the cargo magnet to be directly touching the top of the cargo box.
■ The mechanical arm lowers the box, placing it in a new position. ■ The mechanical arm extends upwards, leaves the cargo box in the new location, and rotates back to its original position. The table below breaks down the action indicating what action occurs for each object at the specified keyframes.
To pose the mechanical arm you select either the ArmControl or SwivelBase nodes and set a keyframe depending on which component you want to pose: ■ ArmControl controls the movement of the mechanical arm. ■ SwivelBase controls the rotation of the arm. ■ CargoBox’s position is based on the parent constraint weights. Animating an IK system The animation sequence occurs over a 180 frame period. Before you begin to set keyframes you set the playback range in the Animation Timeline/Slider.
To set the remaining keyframes for the arm and the swivel base, use the table below as a guide, and set the attributes in the following order: ■ Set the frame using the Time Slider. ■ Set the attributes for the object in the Channel Box. ■ Set the keyframe (Animate > Set Key). NOTE Don’t be concerned if the list of keyframes indicates to set a key twice for the same position over two frames. This is necessary to animate the parent constraint weights over a period of one frame.
Frame Select Set attribute Select 160 ArmControl TransY: 6 TransZ: -13 Set Key 180 ArmControl TransY: 0 TransZ: -13 Set Key Once the keyframes for the mechanical arm are set you can use the playback controls to playback the motion for the mechanical arm. To playback the animation using the playback controls 1 Click play on the TimeSlider playback controls to play the animation. The mechanical arm animates over 180 frames.
5 Right-click on either one of the selected names. A drop-down list appears. 6 From the drop-down list, choose Key Selected. Key Selected sets a keyframe for the selected attributes only. To set the remaining keyframes for the parent constraint weights, use the table below as a guide, keeping in mind that you set the attributes in the following order: ■ Set the frame using the TimeSlider. ■ Set the parent constraint attributes in the Channel Box.
2 Click stop on the TimeSlider playback controls to stop the playback. You have completed this lesson. Beyond the lesson In this lesson, you completed the animation of a mechanical arm model that picked up and moved a cargo box. You learned how to: ■ Construct a model hierarchy to provide relationships between the components for posing and keyframing. ■ Construct a single chain skeleton to pose the arm model using Inverse Kinematics. It is common to create characters with multiple joint chains.
■ Apply limits to the movement of the IK system. In this lesson, you constrained the translation of the control object in order to constrain the movement of the IK. It is not recommended that you set limits on the rotation of an IK system as it limits how the solver calculates the position of the joints. See Setting up joints for posing and animation in the Maya Help.
Character Setup 7 Introduction A typical 3D character can be made up of many surfaces and components. To ensure that the character animates in the way that you want, it is important to carefully plan the process of character setup. Character setup or rigging is the general term used for the preparation of 3D models with their accompanying joints and skeletons for animation.
■ Lesson 2 Smooth skinning: Introduction on page 333 ■ Lesson 3 Cluster and blend shape deformers: Introduction on page 344 Preparing for the lessons 1 To ensure the lessons work as described, select the Animation menu set. Unless otherwise noted, the procedures in this chapter assume the Animation menu set is selected. 2 If you have not already done so, copy the GettingStarted folder from its installation location to your projects directory. Then, set the GettingStarted directory as your Maya project.
Learning how to bind a character to a skeleton is described in the next lesson. Open the scene for the lesson In this lesson, you’ll work with a scene that we created for your use. The scene contains a human character. In the remainder of the lesson, you’ll create and animate a skeleton for the character. To open the scene 1 Make sure you’ve done the steps in Preparing for the lessons on page 318. 2 Open the scene file named Skeleton.mb.
To create joints for the legs 1 Select Window > Settings/Preferences > Preferences. In the Preferences window, click the Kinematics Category. Enter 0.4 for the Joint Size, then click Save. This displays the joints smaller when you create them in the next steps. At the default size, 1.0, the size of the joints makes them hard to position accurately for this character. NOTE The default joint size of 1.0 has been used to create the joints pictured in the following illustrations.
4 Press Enter (Windows and Linux) or Return (Mac OS X) after creating the toe joint. This completes the joint chain. 5 Select Window > Hypergraph: Hierarchy. The Hypergraph is a convenient place to select, rename, and parent objects. It is similar to the Outliner, but it has features tailored for character setup. For example, it depicts all parent-child relationships in an easy-to-read indented format. The Hypergraph shows the default names given to the joints just created: joint1, joint2, and so on.
moving joints below it in the hierarchy. (To exit this mode, press Insert or Home again.) NOTE You may need to rotate left_hip so that the skeleton fits inside the leg. It’s unnecessary to fit the skeleton perfectly inside the character, as it won’t be displayed when you render an image from the scene. 8 To create the joints for the other leg, you can save time and ensure symmetry by duplicating the existing leg joint chain with mirroring.
To create joints for the spine and jaw 1 In the side view, use the Joint Tool to create a series of joints at the locations shown here. Start at the base of the spine near the existing hip joints (left_hip and right_hip) and end at the top of the head. Make sure you create the first joint a little bit away from the existing hip joint displayed in the front view. Otherwise the first joint will be connected to the hip joint.
2 Starting at the base of the spine, name the joints back_root, pelvis, lower_back, mid_back, upper_back, lower_neck, upper_neck, and crown. 3 To set up the skeleton for jaw movement, extend a joint from the upper_neck joint. With the Joint Tool selected, click the upper_neck joint in the Hypergraph to select it, then click to create a new joint near the lips, and press Enter or Return. Name the new joint as jaw. Creating joints for the arms is similar to creating joints for the legs.
Moving the joint to the back of the arm creates a bend at the elbow. This will make it easier to animate the character’s arm in the direction an arm naturally bends. 4 In the perspective view, select left_arm_root. Select Skeleton > Mirror Joint. This creates a copy of the left arm’s joint chain for the right arm and renames them in the process. The right arm bones and joints appear in a mirrored position.
shoulder and spinal rotations. The rib joints are for structure only, not for posing the skeleton. To add ribs to the skeleton 1 In the Hypergraph, click the mid_back joint to highlight the joint in the front view. Remember the location of the joint in the front view so you can select it later. 2 Select Skeleton > Joint Tool. 3 In the front view, click on the mid_back joint to select it again. 4 Click to the side of the joint to add a rib bone, then press Enter (Windows and Linux) or Return (Mac OS X).
Creating a skeleton hierarchy So far you have created five separate joint chains: one for the spine, and one for each arm and each leg. You need to create a single hierarchy from the five joint chains so you can move all of them as a single unit. To create the single hierarchy, you parent the arms and legs to the nearest joint in the spine. To parent the arm and leg joint chains to the spine 1 In the Hypergraph, use the middle mouse button to drag left_arm_root to upper_back.
Forward kinematics (FK) To pose a character with forward kinematics, you rotate each joint individually until you get the desired positioning. For example, to move a hand to some location, you must rotate several arm joints to reach the location. When you animate a skeleton posed with forward kinematics, Maya interpolates the joint rotations starting with the root joint, then the root’s child joints, and so on down through the skeleton’s action hierarchy.
This makes it easier to pose the character with motion that is natural for a human character. 2 Select Jackie in the Outliner and, from the main menu, select Display > Hide > Hide Selection. (You must select Jackie from the Outliner because Jackie is a template object.) By hiding Jackie, you’ll lessen scene clutter as you pose the skeleton in the following steps. To create, pose, and animate IK handles for the legs 1 Select Skeleton > IK Handle Tool > .
8 Set another key for the IK handle. 9 Go to frame 24. Move the IK handle back to its prior position. Set another key. 10 Play the animation to see the leg step up and down during the first 24 frames. This completes a simple animation of the leg using an IK handle to control its position. To practice additional IK techniques 1 Go the start of the animation. 2 In a perspective view, practice posing the leg in various directions by moving the IK handle.
The default IK handle (IK Rotate Plane handle) has manipulators you can use to avoid joint flipping. With the handle selected, select Modify > Transformation Tools > Move Tool, Rotate Tool, Scale Tool, Show Manipulator Tool. Move the Pole Vector XYZ manipulator to a slightly different position (see the following figure). If this doesn’t solve the problem, rotate the Twist manipulator to rotate the leg.
3 Select Skeleton > IK Handle Tool. 4 Click right_shoulder, then click right_wrist. This creates an IK handle for the right arm. 5 Practice posing and animating the handles. Posing and animating using forward kinematics As the last part of the lesson, you can optionally practice posing and animating the character by rotating joints that are not controlled by IK handles—the ball joints of the feet, and joints from the back_root through the upper_neck. Rotating such joints is forward kinematics.
■ When you create a skeleton, you can animate a character bound to it to produce natural skin deformations. Although you animated an unskinned skeleton in this lesson, it’s more common to animate a skinned skeleton. Binding a character is the topic of the next lesson. ■ It’s typically best to animate the entire skeleton from pose to pose at desired frames. It’s hard to get desired results by animating one limb for a frame range, another limb for a frame range, and so on.
■ View and modify skin weights using the Skin Weights Tool. ■ Use influence objects to enhance the skin deformation of a character. Open the scene for the lesson In this lesson, you work with a scene we created for your use. The scene contains a human character and skeleton. Each leg and arm of the skeleton has an IK handle that lets you pose the limbs conveniently. If you completed the prior lesson, the character, skeleton, and IK handles will be familiar.
The back_root joint is at the base of Jackie’s spine. If you are not sure which joint it is, select it in the Hypergraph (Window > Hypergraph: Hierarchy). 3 Select Skin > Bind Skin > Smooth Bind > . The Smooth Bind Options window appears. 4 In the Smooth Bind Options window, set Max Influences to 3, then click Bind Skin. A Max Influences value of 3 specifies that three joints influence each skin point. By default, the joint closest to the point has the most influence.
There are two ways to improve the smooth skin deformations: ■ Add an influence object to eliminate collapsing regions or to create muscle bulge. For example, you can use an influence object to make the shoulder region look more natural in the prior pose. ■ Edit skin weights—to remove minor lumps or indented regions. For example, you can fill out an undesirable concave region at the chest that appears when you move the arm to certain poses. The following procedures explain the techniques.
2 Select Jackie. 3 Select Skin > Edit Smooth Skin > Paint Skin Weights Tool > . 4 In the Influence list of the Tool Settings window, select any joint, for instance, pelvis. The grayscale color of Jackie’s skin indicates how much influence that joint has on the skin’s deformation. White means the skin is maximally influenced by the joint. Black means the skin is not influenced by the joint. Gray means the influence is partial. The lighter the gray, the more the influence.
Modifying skin weights You can modify the skin weights for any of the influencing joints to alter the irregular region. If you don’t get the desired results when you change the skin weights of one of the influencing joints, you can undo your changes and try another influencing joint. In general, it’s best to modify the skin weights of the most influential joint first, then work with less influential joints if you don’t get the desired results. Modifying skin weights requires experimentation.
5 To continue modifying the skin weights with the Paint Skin Weights Tool, select Jackie and once again select Skin > Edit Smooth Skin > Paint Skin Weights Tool. There are several additional tool settings you might find useful as you modify skin weights: ■ The Smooth operation smooths the weights of points by averaging the stroked points with the weights of the surrounding region. This is useful if you add to the weight values in some region but the points become unevenly weighted.
not in another. Strive to make the surface look good in the poses that you are likely to use during animation. Influence objects You can create an object and use it to influence the shape of smooth skin. The object, called an influence object, acts like a surgical implant against which the skin deforms. For example, you can create a sphere and use it to simulate a muscle or bone that bulges as you pose the character in certain positions.
6 Turn on Modify > Evaluate Nodes. You must do this step to enable the IK solvers so you can manipulate IK handles in the scene again. To position a sphere to be used as an influence object 1 Right-click Jackie’s surface (anywhere but on the skeleton) and select Actions > Template from the marking menu. By making Jackie a template, you won’t accidentally select Jackie in subsequent steps. 2 Create a sphere (select Create > Polygon Primitives > Sphere >) and name it elbow_influence.
3 In the Hypergraph, Shift-select elbow_influence, elbow_influenceBase, and left_shoulder joint, in that order. The order of selection is important. The parent object should be selected last. 4 Press p to parent the elbow nodes under the left_shoulder joint. The elbow_influence nodes appear in the skeleton hierarchy below the left_shoulder joint. The elbow_influenceBase is known as a base object. It stores vertex position information for the influence object.
Beyond the lesson In this lesson you learned how to: ■ Bind a skeleton to a single surface. You can bind a skeleton to multiple surfaces or even to a selection of polygonal vertices or NURBS CVs or subdivision surfaces. ■ Use the Paint Skin Weights Tool to prevent a region from collapsing upon deformation. To control skin weights with more precision than shown in the lesson, you can modify skin weights numerically with the Window > General Editors > Component Editor.
Lesson 3: Cluster and blend shape deformers Introduction Facial animation is an integral component of character animation. The face of a character can be animated to impart a range of emotions and expressions. Maya has two deformation tools that ease character setup for facial animation: cluster deformers and blend shape. Cluster deformers enable you to control a set of an object's points (CVs, vertices, or lattice points) with varying amounts of influence to create a target shape for an animation.
3 Select Shading > Smooth Shade All and then Shading > Hardware Texturing, and Lighting > Use All Lights to view the head fully textured (Hotkey 7). Creating a target object for a blend shape In the next steps, you duplicate the face of the head to create a target object for the blend shape. Later in the lesson, you apply a cluster to the duplicated face (target object) so you can create a smile. The facial expression on the target object is what the original base object will match.
4 Rename the duplicate face as smilingFace. This duplicate face will be modified so it can be used to influence the original. Creating a cluster deformer on a target object In the next steps, you create a cluster deformer on the duplicated face (target object) to reshape the expression into a smile. The cluster deformer on the target object will be used to change the unsmiling baseFace (base object) into a smiling face.
The region of selected vertices does not need to be exact. The objective is to select all vertices where a smile might deform the face. You might want to look in a mirror to see which parts of a face move while smiling. It’s better to select too many vertices than too few. It’s easier to work with too many vertices than too few. TIP An easy way to select the vertices is to use the Paint Selection Tool. First, right-click smilingFace in the scene view and select Vertex from the marking menu.
2 Select Create Deformers > Cluster. This puts the vertices into a cluster—a set of points you can move as single entity. The cluster’s handle appears in the view as a C icon. 3 In the Outliner, make sure the cluster2Handle is selected. 4 Use the Move tool to drag the cluster handle up along its Y-axis a small amount until smilingFace is deformed as follows: The cluster set on smilingFace should be slightly higher than the cluster on the original face.
2 Select Edit Deformers > Paint Cluster Weights Tool > the smilingFace in grayscale. . This displays The white area shows the points that make up the cluster. The whiteness also indicates the weights—how much the points move in response to the movement of the cluster handle. White indicates a cluster weight of 1—the points move the same distance as the handle. By default, each point has a weight of 1. Black indicates a cluster weight of 0. The points do not move in response to cluster handle movement.
The selected vertices move down a bit, as the weight of 0.5 lessens the effect of the prior movement of the cluster by 50%. 5 To check the shape with full-color shading, click the Select Tool. (You might also prefer to cancel the selection of smilingFace to eliminate the display of the highlighted wireframe.) 6 To return to the Paint Cluster Weights Tool, select smilingFace and Edit Deformers > Paint Cluster Weights Tool > again. 7 In the Tool Settings window, set the following ■ Radius(U): 0.
While painting weights, it’s useful to intermittently check the shape with with full-color shading rather than with the grayscale shading. To do this, click the Select Tool to turn off the Paint Cluster Weights Tool. (You might also prefer to cancel the selection of smilingFace to eliminate the display of the highlighted wireframe.) 9 Enter a Value of 0.
move up slightly also. (For many people, skin at the chin and neck moves during smiling.) 10 In the tool settings editor for the Paint Cluster Weights Tool, set the Paint Operation to Smooth. Paint any region where the surface has become irregular. Irregular regions are typically indicated by jagged wireframe curves (isoparms) or where a grayscale color makes an abrupt change to a lighter or darker color. Smoothing averages the weights of the stroked points with the weights of the surrounding region.
4 Select Window > Animation Editors > Blend Shape. This displays the Blend Shape editor, which has a slider for changing the base into the target shape, and buttons for setting keys. 5 Cancel the selection of the faces so you can see the surfaces without the obscuring highlighted wireframe. 6 Drag the slider from 0 to 1 to morph the baseFace into the target, smilingFace. Note that you can click the Key button below the slider to set an animation key for the shape of the face at the current frame.
Refining deformation effects The combination of a cluster and blend shape is ideal for facial animation because it lets you tune various subtle deformations. A few common techniques follow. ■ In the box below the slider of the Blend Shape editor, you can enter a numerical value below 0 to invert the deformations, or above 1 to amplify the deformations. For example, -1 creates a frown, while 1.
undesirably or doesn’t give the exact look you desire. You can also use Ctrl - Z (Windows and Linux) or Control-z (Mac OS X) to undo any undesired changes. Adding target objects to an existing blend shape In the next steps, you duplicate the face again and reshape the duplicate into a new facial expression. You then add the new face to the blend shape node to create another slider in the Blend Shape Editor.
For these vertices, you need to select the vertices by dragging a selection box rather than by using the Paint Selection Tool. The eyebrows have vertices that lie behind its outer surface. The Paint Selection Tool selects only vertices at the outer surface. Dragging a selection box selects all vertices in the boxed region, including vertices that lie behind the outer surface.
8 Select Create Deformers > Cluster. 9 In the perspective view, turn off the selection of Show > Isolate Select > View Selected. Do this again in the front view. By turning off these menu selections, Maya displays all objects in the views again.
4 You can use the sliders alone or in combination to create a smile with raised eyebrows, a frown with lowered eyebrows, and so on. 5 You can optionally select raisedBrow and edit the cluster weights to tune the deformation of the eyebrow region as desired. See Editing cluster weights on page 348 for details.
TIP After you create a blend shape, you can optionally hide or delete a target object (in this lesson, smilingFace and raisedBrow). If you delete a target, you improve Maya processing time but lose the capability to manipulate the cluster handle. For versatility, many animators hide the target rather than delete it. Hiding the target is necessary when you render the scene. It is also useful when you want to unclutter the scene view.
Before you create the blend shape, turn on In-Between in the Create Blend Shape options window, and select the multiple targets in this order: least extreme shape difference first, most extreme shape difference last. Although the lesson showed how to blend individual objects, you can also blend hierarchies of objects. See the Maya Help for more information.
Polygon Texturing 8 Introduction Texture maps let you modify the appearance of your 3D models and scenes in Maya. Texture maps are images you apply and accurately position onto your surfaces using a process called texture mapping. When an image is texture mapped onto a surface, it alters the appearance of the surface in some unique way. Texture maps let you create many interesting visual effects: ■ You can apply labels and logos to your surfaces.
Most shading attributes for a surface material can be altered by a texture map. For example, color, specular, transparency, and reflectivity are examples of attributes that can be modified by a texture map. Texture mapping is a key component in the 3D production workflow. Many production environments employ texture artists whose only role is to create and apply the texture maps to 3D models.
Lesson 1: UV texture mapping Introduction There are several techniques for texture mapping 3D surfaces depending on the surface type (NURBS, polygons, subdivision surfaces). Some techniques involve preparing the surfaces for texture mapping. For example, when texture mapping polygonal and subdivision surface types you need to understand how textures are applied using UV texture coordinates.
modifying the UV texture coordinates so that the texture map appears correctly on the surface. In this lesson you learn how to: ■ Assign a 2D texture map to a polygonal model. ■ Map UV texture coordinates (UVs) to a polygonal surface. ■ Correlate the UVs between the scene view and the UV Texture Editor. ■ Use the UV Texture Editor to visualize how the UV texture coordinates from a three-dimensional model relate to an assigned two-dimensional texture map. ■ Determine basic UV layout requirements.
■ Height divisions: 1 ■ Depth divisions: 1 ■ Axis: Y ■ Create UVs: On ■ Normalize: Off A cube primitive in the shape of a rectangular box appears in the scene view. When the Create UVs option is on it ensures that the primitive object is created with a set of default UV texture coordinates. All polygon primitives in Maya provide an option for creating UV texture coordinates at the time of creation.
referred to as a file texture. In this lesson, you apply a texture map we’ve created for your use on the cracker box. For more basic information on shading materials and texture maps see the Rendering chapter of this guide and the Maya Help. To assign a shading material to the cracker box 1 In the scene view, select Shading > Smooth Shade All from the panel menu. This displays the cracker box with a default gray, smooth shading material, lit using default lighting.
The new Lambert material is identical to the default gray material that was previously assigned to the cracker box. However, it’s always a good practice not to modify the default shading material in the scene and create a new shading material and modify it to suit your requirements. 3 In Attribute Editor, double-click in the lambert2 box and then type: box_material to rename the shading material. Renaming the shading material lets you easily identify it later on when you need to edit it.
5 Click the Map button located to the right of the Color slider. The Create Render Node window appears and lists the various texture options you can apply (or connect) to the color channel of the box material. 6 Click PSD File from the list of 2D Textures. Choosing this option specifies that you want to apply an Adobe® Photoshop® format file as a texture. A PSD format file lets you keep the various components of your texture map on multiple layers.
A browser window appears with the path set to the default project directory. By default, Maya looks for source images for texture maps in a sourceimages folder whenever the project folder is set. Maya can use file texture images from anywhere on your workstation or local network. For example, you can have images on a central disk drive that is shared among users in a production environment. 8 Select the image file named UVLesson.psd.
A small preview of the image appears in the Texture Sample box in the Attribute Editor. When a texture is applied to a shading material its attributes get added to the existing attributes for shading material. That is, all of the existing shading attributes remain unchanged except for the attribute that gets modified by the texture. In this case, the grey color is substituted by the image of the cracker box artwork.
The texture map does not appear correctly on the cracker box model. The texture map was designed so that specific sides of the box receive specific regions of the image. Instead, the complete image is being placed on every side of the object. To correct this problem you must modify the default UV texture coordinates for the model so they match the layout of the texture image. To do this, you use the UV Texture Editor.
The panel layouts update to display the Perspective view in the left pane and the UV Texture Editor in the right pane simultaneously. (You can close the Attribute Editor if it is still displayed.) This two pane layout is helpful for two reasons: ■ The two view layout shows you how one item selected in the 3D view relates to the UVs displayed in the 2D view of the UV Texture Editor and vice versa, without having to open and close the views repeatedly.
■ When you edit UVs for a surface mesh in the UV Texture Editor, you can immediately see the effect of the texture map on the model in the 3D scene view. UVs do not initially appear in the 2D view of the UV Texture Editor until you select an object or change the selection mode for an object in the scene view. To view UVs in the UV Texture Editor 1 In the scene view, right-click any region of the cracker box model and select Object Mode from the marking menu. 2 Select the cracker box model.
relation to the displayed image has a direct bearing on how the texture gets mapped onto the surface. TIP If the texture map for the cracker box doesn’t appear in the 2D view, select Image > Update PSD Networks in the UV Texture Editor to refresh the 2D view of the UV Texture Editor. Update PSD Network is normally used to refresh a PSD texture in Maya after you have modified the PSD texture in Adobe® Photoshop®.
is because the default UVs for a Maya cube primitive are created based on a predetermined default shape and do not get updated if the shape or scale of the primitive is modified later on. There are a number of things you can do to correct these issues depending on the situation. For this lesson, you will correct the UV and texture map misalignment by doing the following: ■ Map a new set of UVs for the cracker box model that better matches the individual faces of the cracker box.
to a flat 2D view that can be subsequently correlated to your texture map using the UV Texture Editor. In this lesson, you use a feature called Automatic Mapping to create new UVs for the cracker box model. Automatic mapping lets you specify the number of planes that will be used for the UV projection.
Setting Planes to 3 creates UVs based on projections from three separate directions. Setting the Percentage Space option to 2 sets the size of the space that appears between each of the separate UV projections when they are laid out in the UV Texture Editor. When the projection is complete the new projected UVs from the triplanar projection appear in the UV Texture Editor.
The intensity of the image map is reduced so you can view the UV borders on the projected UVs more easily. The new UVs appear in the UV Texture Editor as shown below. ■ The six rectangular UV shapes, referred to as UV shells or simply shells, now match the aspect ratio for each of the six sides of the cracker box better than the earlier UVs. ■ The UV shells fit within the 0 to 1 UV texture range. Automatic mapping fits the UVs to the 0 to 1 range by default.
Working with UVs in the UV Texture Editor When texture mapping a polygon or subdivision surface type model it is often necessary to modify the UV components for a model so they match the texture map. The UV Texture Editor provides many tools for working with UVs. In this section you learn how to: ■ Select UVs from either the scene view or the UV Texture Editor and accurately correlate them. Selecting UV components is critical to modifying them accurately.
2 In the scene view, right-click on the cracker box model and select UV from the marking menu that appears. 3 In the scene view, select one UV on any corner of the cracker box. Selecting a UV is very similar to selecting a vertex on an object. That is, you select a point that resides in exactly the same position as the vertex. When you select a UV in the scene view, the corresponding UV is also selected in the UV Texture Editor.
When you select this edge in the scene view, notice that two corresponding shell edges also get selected in the UV Texture Editor. This indicates the following: ■ The selected edge is shared by two faces; the front and the top. ■ Selecting the top front edge in the scene view, identifies the corresponding front and top UV shells for the box. (Indicated by the selection in the UV Texture Editor.
2 In the UV Texture Editor, select Polygons > Move and Sew UV Edges. The small rectangular UV shell is repositioned to match the top of the large UV shell and the two shells are combined into one. When you later select and move this sewn shell, it will move as one piece. When two UV shells are selected for sewing, the smallest UV shell is moved to the larger.
4 To display the texture borders for the two shells, select Texture Border Edges. (You can also launch this window by right-clicking the Toggle Texture Borders button on the UV Texture Editor’s toolbar.) In the UV Texture Editor, the texture borders for two UV shells now appear with a thicker line. Displaying texture borders on the UV shells is useful for visualizing where the texture borders exist on the 3D model in the scene view.
which UV shells are combined and which shells are not when you have many UV shells displayed in the UV Texture Editor. If you want to be able to view areas where UV shells overlap in the UV Texture Editor select Image > Shade UVs. When Shade UVs is turned on any selected UV shells appear shaded in a semitransparent fashion. Areas where the shading appears more opaque indicate the regions of shell overlap.
The Move Tool manipulator icon appears over the selected UV shell. 7 Drag the green (Y axis) and red (X axis) Move Tool manipulator handles to reposition the UV shell so it matches the displayed texture image. The position of the texture updates on the cracker box model in the scene view as you do this. 8 Select one UV on the other remaining UV shell. The UV coordinate appears highlighted. 9 Convert the UV selection to a shell selection by pressing the Ctrl key and right-clicking in the UV Texture Editor.
11 Confirm that the texture appears correctly on the cracker box model in the scene view by tumbling the scene so you can view the back of the box. TIP If the texture appears upside down, you can continue to rotate it another 180 degrees. If the texture appears reversed, that is, the letters are backwards, you can correct this by selecting Polygons > Flip from the UV Texture Editor menu and choosing the appropriate option setting. 12 From the UV Texture Editor menu, select Tool > Move UV Shell Tool.
TIP The exact UV boundaries can be viewed more clearly when the anti-aliasing for the texture image is temporarily turned off. To do this, select Image > Display Unfiltered to view the texture image without anti-aliasing. If you need to move a single UV so it precisely matches a particular location on the texture map you can turn on Pixel Snap (Image > Pixel Snap). When you select and move the UV using the Move Tool, it will reposition the UV coordinate based on pixel boundaries.
PSD Network in the UV Texture Editor so the texture map gets updated on the model in the Maya scene. If you would like to learn how to render an image of the cracker box model see the Rendering chapter of this guide as well as the Maya Help to learn more about lighting, shading, and rendering. This lesson used a simple polygonal model to introduce the fundamental concepts.
Lesson 2: UV unfolding Introduction While texturing a flat object is fairly straightforward, texturing an object with curves can pose some unique problems. How do you paint a 2D texture on a curved surface? How do you deal with a texture warping over bumps and grooves? If you try to break apart the UV mesh like Lesson 1, you can potentially end up with hundreds of small pieces. To deal with these problems, artists typically use a workflow called unfolding or pelting.
In this lesson you learn how to: ■ Divide a mesh into separate parts for texturing. ■ Assign a basic checker pattern to judge the quality of a mapping. ■ Create a planar mapping. ■ Cut UV edges. ■ Unfold a UV mesh using the Unfold option. ■ Fix an unfolded mesh using the Smooth UVs tool. Lesson Setup To ensure the lesson works as described, do these steps before beginning: ■ Make sure you’ve done the steps in Preparing for the lesson on page 362.
Dividing the mesh If you select the polygon soldier and look at the UV Texture Editor, notice that the UVs for the body, arms, and legs are scattered in a pattern that doesn’t resemble the actual model. This isn’t very helpful for painting a texture map.
To simplify the job, you need to divide the mesh into multiple pieces that you can then texture individually. Generally, you want to divide the mesh into pieces that can be unfolded into approximate square or rectangle shapes. This requires some pre-planning. In this lesson you divide the body mesh into a torso, arms, and legs. To divide the mesh into pieces 1 In the panel menu select Panels > Orthographic > front. The perspective view changes to an orthographic front view of the soldier.
2 Right-click the mesh and select Face from the marking menu. 3 Drag-select the faces on the right arm up to the shoulder. 4 Select Mesh > Extract.
Now you change the selection mask back to Object, you can select the hand separately from the rest of the body. 5 Repeat steps 1-3 for the following areas (use the pictures as reference for the boundaries of each extraction).
This leaves you with individual meshes for the arms, legs, and chest. The head, feet, and hands have already been done for you. This division allows you to texture each part individually. Creating a planar mapping To texture an organic object, you must start by creating a planar mapping as a base, which you can then unfold. To create a planar map for the torso 1 Right-click the torso and select Object mode from the marking menu. 2 Select the torso. 3 Select Create UVs > Planar Mapping > .
Maya creates a new UV mapping for the torso. If you look at the UV Texture Editor, you can see the new UVs look like a flattened version of the front of the chest. At first glance this may seem perfect, but there’s a major problem here that you need to change the UV Texture Editor view to shaded mode to see. To turn on shaded UV display 1 Select Window > UV Texture Editor. The UV Texture Editor appears. 2 In the UV Texture Editor, click the Shade UVs icon ( Image > Shade UVs.
Notice that all the faces for the torso are red. This is because the faces of the front and back of the torso are overlapping. If you tried to apply a texture to the UV mesh like this, you would get the exact same image on the front and the back of the torso. To fix this, we need to unwrap the texture so that front and back no longer overlap. Unfolding a UV mesh Unfolding a UV mesh is the process of cutting a mesh so that you can lay its entire surface area flat.
7 In the panel menu, select Panels > Perspective > persp. From the front view, the checker pattern looks roughly even with very little distortion. This indicates that the spread of UVs is fairly even. An even spread of UVs is important to avoid texture warping when you apply your texture. In some cases you may need to experiment with different planar mappings to give you the best base to start with. However, the planar projection isn’t perfect.
To cut the UV edges 1 Right-click the vest and select Edge from the marking menu. 2 Select all the edges in a line that runs from under the arm, down the side of the soldier’s body to the bottom of the vest. You can do this by double-clicking edges along this path until they are all selected. 3 Shift-select the corresponding edges on the other side. An edge loop on both sides should be selected now. 4 In the UV Texture Editor, select Polygons > Cut UV Edges. Now you are ready to unfold the mesh.
3 In the UV Texture Editor, select Polygons > Unfold > . The Unfold UVs Options window appears. 4 Select Edit > Reset Settings. 5 Set Pin UVs to Pin selected UVs. A pinned UV does not move when a UV mesh is unfolded. In general, you want at least one pinned UV when unfolding because it gives the unfold process a point of reference. This is similar to placing a pin in a piece of fabric so that it does not unfurl out of control as you unfold it. 6 Click Apply and Close.
Unfortunately, while you’ve minimized the distortion, you’ve also create a visible seam where you cut the UV edges. Unfortunately this is unavoidable. In general it is best to put your seams in the least visible places. In this case, the seams will be obscured by the arms most of the time and therefore won’t be as noticeable. Adjusting the checker pattern Although not always necessary, it is often helpful to increase the number of squares in your checker pattern.
To increase the number of squares in the checker pattern 1 Right-click the torso and select Object Mode from the marking menu. 2 Select the torso in the perspective view. 3 Open the Attribute Editor and navigate to the checker_pattern tab. 4 Click the box next to Color. 5 In the place2dTexture tab, set Repeat UV to 10, 10. The number of squares on the torso increases. Outputting UVs Now that you have your unfolded UVs, you need to export them so that you can draw a texture on them.
4 In the UV Texture Editor, scale the UV mesh so that it fits inside the upper-right square of the UV Texture Editor. This step is necessary because a UV snapshot only captures what is in the 1 x 1 UV texture space (the upper right corner). 5 Right-click the torso in the perspective view and select Object Mode. 6 Select the torso. 7 In the UV Texture Editor, select Subdivs > UV Snapshot. The UV Snapshot options window appears. 8 Click the Browse button. A file browser appears.
You can now open this file using an external image editor and paint your texture using the mesh as a guide. NOTE If your image editing software does not support Maya .iff images, you can change the image format in the UV Snapshot options window and then export the file again. Unfolding with constraints Sometimes you only need to unfold a UV mesh in one direction. This is especially useful when there is only a single seam.
To unfold the arms 1 Select the soldier’s left arm. 2 Select Create UVs > Planar Mapping. 3 Right-click the arm and select Assign Existing Material > checker_pattern. 4 Right-click the arm and select Edge from the marking menu. 5 Select the edges on the bottom of the arm at the center of the distortion just under the elbow.
6 In the UV Texture Editor, select Polygons > Cut UVs. 7 Right-click the arm and select UV from the marking menu. 8 Drag-select all the UVs on the arm and click the Rotate clockwise button ( ). The UVs rotate so the arm in the UV Texture Editor is vertical. 9 Select one UV at the top of the arm’s tricep and another UV at the tip of the soldier’s cuff.
10 In the UV Texture Editor, select Polygons > Unfold > . The Unfold UVs Options window appears. 11 Set Unfold constraint to Horizontal. 12 Click Apply and Close. The UV mesh for the arm is unfolded evenly up and down. This is better than the UV mesh we would get if we unfolded in all directions.
Now you can output these UVs to a file. To export the UV snapshot 1 Right-click the arm in the UV Texture Editor and select UV from the marking menu. 2 Drag-select all the UVs on the UV mesh. 3 Select the Scale Tool. 4 In the UV Texture Editor, scale the UV mesh so that it fits inside the upper-right square of the UV Texture Editor. This step is necessary because a UV snapshot only captures what is in the 1 x 1 UV texture space (the upper right corner).
9 Navigate to GettingStarted/UVMapping and enter the name left_arm_UVs. 10 Set Image Format to GIF. 11 Click Save. 12 Click OK. Like the torso you did in the previous step, Maya outputs a .gif file containing the UV mesh. You can import this file into an image editor and use it as a template to create a texture. Now repeat the entire procedure for the right arm. Note that you do not need to output the UVs for the right arm because it will use the same texture as the left arm.
■ You do not need to pin any UVs for the pants. ■ Like the arms, unfold the UV mesh horizontally.
As with the torso and arms, you can now output these UV meshes to an external file to paint a texture on them. For information about how to do this, see Outputting UVs on page 402. Sewing UV Edges Depending on the mapping you start with, you may sometimes find that your UV mesh is broken up in ways that can ruin your final result. In these cases, you can manually sew UV edges back together. To map the head to the UV space 1 Select the head and select Create UVs > Cylindrical Mapping.
2 Right-click the head and select Assign Existing Material > checker_pattern.
Notice that because you started with a cylindrical mapping, the checker pattern on the sides of the head aren’t warped like in the previous examples. Unfortunately, if you tumble the camera you can see that the top of the head is now warped. In this particular case this is preferable and you will see the reason why later.
3 In the UV Texture Editor, select Polygons > Sew UV Edges. The thick blue edges change to match the other edges. Notice that after sewing the UV edges together, the distortion has actually gotten worse. However, this is only temporary and is fixed when you perform the unfold.
To unfold the helmet’s UV mesh 1 In the UV Texture Editor, right-click the face mesh and select UV from the marking menu. 2 Select the UVs down the center of the face starting from the tip of the helmet’s rim to the bottom of the neck. 3 In the UV Texture Editor, select Polygons > Unfold > . The Unfold UVs Options window appears 4 Set Pin UVs to Pin selected UVs. 5 Click Apply and Close. The face unfolds evenly across the texture space.
Smoothing/Relaxing a mesh interactively Sometimes you only want to partially unfold a mesh. For this, you can use the UV Smooth tool to interactively unfold or relax the mesh. To partially unfold the UV mesh 1 In the UV Texture Editor, select all the UVs. 2 Select Tool > Smooth UV Tool > . The Smooth UV Tool options window appears. 3 Select Edit > Reset Settings. 4 Set Space to UV Space. 5 Click Apply and Close. Two controls appear over the UV mesh called Unfold and Relax.
If you reach the edge of the screen you can release the mouse button, click the Unfold control and drag again. Fixing problem areas You now have an unfolded UV mesh with no major overlapping faces. However, there are still a few minor problem areas where the mesh overlaps itself (particularly the eyes and mouth). You can use the Smooth UV Tool to fix small imperfections in the shell with targeted unfolds or relax operations.
3 In the UV Texture Editor, Ctrl + right-click the UV mesh and select To UV from the marking menu. The edges selected around the eyes are converted to the UVs selected around the eyes.
4 Click the Smooth UV Tool icon ( ). 5 Drag the Relax control to the right until the eyes appear round. As you drag the Relax control, the selected UVs relax until they are round. Now you can fix the nose and mouth in a similar manner. To fix the nose 1 Select a group of UVs on and around the nostrils.
2 Drag the Relax control to the right until the UVs stop moving.
To fix the mouth 1 In the perspective view, right-click the head and select Edge from the marking menu. 2 Shift-select the 4 edge loops around the mouth. You can do this quickly by Shift + double-clicking one edge in each loop. 3 In the UV Texture Editor, Ctrl + right-click the UV mesh and select To UV from the marking menu. The edges selected around the mouth are converted to the UVs selected around the mouth.
4 Drag the Relax control to the right until the UVs stop moving. The mouth UVs even out into a circular shape. 5 Select all the UVs on the head.
6 Select the Scale Tool and scale the UVs so that they fit in the upper right corner of the UV space. The UV mesh for the soldier’s head now has no UV faces overlapping. This allows you maximum control over what shows up in each portion of the head when you create the texture map for the soldier. As with the rest of the body, you can now output these UV meshes to an external file to paint a texture on them. For information about how to do this, see Outputting UVs on page 402.
Once you’ve created associated texture files, you need to apply them to your model. For the purposes of this tutorial, textures have been provided for you in the sourceimages folder. To apply the texture for the torso 1 In the perspective view, right-click the torso and select Assign New Material > Lambert from the marking menu. The soldier’s torso turns matte grey. 2 Open the Attribute Editor and select the lambert tab. 3 Change the name of the lambert material to Mat_Torso. 4 Click the box next to Color.
8 In the Attribute Editor, in the Mat_torso tab, click the box next to Bump Mapping. The Create Render Node window appears. 9 Click File. A file tab appears in the Attribute Editor. 10 Click the browse icon next to Image Name. A file browser appears. 11 Navigate to the Getting Started folder and select UVMapping/sourceimages/soldier_torso_normals.tif. Normal maps appear on the soldier’s chest. Normal maps give the flat portions of the texture the illusion of 3D bumps.
Now you can repeat the process for the other body parts by applying the following textures: Appendage Material node name Texture filename Normals filename Left Arm Mat_Arm soldier_arm.tif soldier_arm_normals.tif Right Arm Mat_Arm (reuse from above by using Assign Existing Material) soldier_arm.tif soldier_arm_normals.tif Legs Mat_Legs soldier_legs.tif soldier_legs_normals.tif Left Foot Mat_Feet soldier_foot.tif soldier_foot_normals.
NOTE When reusing a texture for a mirrored appendage (Right Arm or Right Foot), you must flip the UVs in the UV Texture Editor to fit the texture. You can do this by selecting all the UVs and clicking the Flip UVs in the U Direction button ( ) in the UV Texture Editor. Beyond the lesson In this lesson you learned how to unfold a UV mesh so that you can create a texture for a complex organic mesh. ■ You can divide a mesh into parts for texturing. ■ You can create a planar mapping of UVs.
■ You can apply a basic checker texture to find problem areas. ■ You can cut UV edges in obscure areas to create a seam for unfolding. ■ You can pin a UV and unfold a mesh in all directions or constrained to a single direction. ■ You can partially unfold a UV mesh with the UV Smooth Tool. ■ You can relax UVs to fix problem areas. Lesson 3: Normal mapping Introduction Normal mapping is a technique in which you use a high resolution mesh to generate a map for a low resolution mesh.
A normal map differs from a texture map in that it produces a multi-channel image (shown below) based on the normals of the high resolution (source) mesh. This information is used to light the mapped details on a low resolution (target) mesh convincingly, even though the surface itself is relatively flat. In this lesson you learn how to: ■ Create and apply a normal map. ■ Display the poly count for a scene. ■ Set the Search Envelope for a target mesh.
Open the scene for the lesson To create a normal map you need two files, the source and the target. The source model is generally a higher resolution and more detailed version of the target model. The target has the geometry you actually want for your scene. To open the high resolution model 1 Select File > Open Scene. 2 Navigate to GettingStarted/UVMapping and select Toad_hi_res.mb. 3 Click Open. A high resolution polygonal toad model appears in the scene. 4 Tumble the view around the toad model.
3 Click Apply and Close. Statistics about the scene appear in the top left corner of the main viewport. This model consists of over a hundred thousand faces just for the head and upper torso. Loading such a high resolution model into the scene is impractical for performance purposes. Now compare the high resolution mesh with the low resolution alternative. To import the low resolution model 1 Select File > Import. 2 Navigate to GettingStarted/UVMapping and select Toad_lo_res.mb. 3 Click Open.
Creating a Normal Map A normal map is a type of transfer map, meaning that it is a texture created from a polygon object. Different transfer maps handle the conversion from polygons to textures in different ways. A normal map captures the surface normal information of the source mesh and uses it to light the target mesh. To set a base material for the target mesh 1 Right-click the mesh and select Assign New Material > Blinn from the marking menu.
To create a normal map 1 Select Lighting/Shading > Transfer Maps. The Transfer Maps window appears. The Transfer Maps window lets you create various textures based on mappings from polygon models. First you need to assign the source and target meshes for the transfer. 2 In the Outliner, select lo_res_toad. 3 In the Transfer Maps window, in the Target Meshes section, click Add Selected. 4 In the Outliner, select hi_res_toad. 5 In the Transfer Maps window, in the Source Meshes section, click Add Selected.
3 Set Display back to Mesh. Now you can set the normal map options. To set the normal map options 1 In the Transfer Maps window, under Output Maps, click Normal. 2 In the Normal Map text field, click the browse icon ( ). A file browser appears. 3 Navigate to Getting Started/UVMapping and enter the name toad_texture. 4 Click Save. 5 Set File Format to DDS (dds).
6 In the Transfer Maps window, set the following: ■ Under Connect Output Maps, set Connect maps to to Assigned shader. ■ Under Maya Common Output, set Map width and Map height to 1024 and Sampling quality to Medium (4x4). 7 Click Bake and Close. Maya generates a normal map. NOTE It may take a few minutes for Maya to generate the normal map. Viewing a normal map Now that Maya has generated the normal map, you need to change the render mode to High Quality Rendering mode to see it.
Beyond the lesson In this lesson you learned how to use a high resolution model to create a normal map for a low resolution model. You learned how to: ■ Display the poly count for a scene. ■ Set the source and target for a normal map. ■ Set the Search Envelope. ■ Switch between Default Quality Rendering and High Quality Rendering. You can also try applying other types of transfer maps to a low polygon model. Each mapping feature gives you slightly different looks on your low polygon model.
Rendering 9 Introduction In Maya, rendering refers to the process of creating bitmap images of your scene based on the various shading, lighting, and camera attributes that you set. When rendering, Maya takes into account all of the various objects and scene attributes, and performs mathematical calculations to produce the final image or image sequence. Once you render a sequence of images, you can then play them back in sequence, producing an animation.
■ Lighting and shadows ■ Cameras and animation ■ Rendering method ■ Visual effects In Maya, rendering can be accomplished using software (Maya Software Renderer, mental ray® for Maya® Renderer, or the Maya® Vector Renderer) or hardware rendering methods. Each type has its distinct advantages. Which renderer you decide to use will be determined by your image requirements (that is, the look you require) and time constraints.
Preparing for the lessons 1 If you have not already done so, copy the GettingStarted folder from its installation location to your projects directory. Then, set the GettingStarted directory as your Maya project. For more information, see Copying and setting the Maya project on page 25. 2 To ensure the lessons work as described, select the Rendering menu set. Unless otherwise noted, the directions in this chapter for making menu selections assume you’ve already selected the Rendering menu set.
Open the scene for the lesson In this lesson, you render a scene we’ve created for your use. 1 Make sure you’ve done the steps in Preparing for the lessons on page 439. 2 Open the scene file named apple.mb. This file can be found in the GettingStarted directory that you set as your Maya project: GettingStarted\Rendering\apple.mb The scene contains an apple sitting on a plane, with another plane as the background. A camera in the scene is animated to revolve around the apple at varying distances.
Creating shading materials for objects A shading material is a collection of attributes that you apply to a surface to control how the surface appears when it is rendered. Shading materials include such attributes as color, shininess, and texture. The following table outlines the materials you’ll be working with: Material Description Lambert Creates a matte surface without specular highlights. Lambert is the default shading material.
The apple and the other surfaces appear with a default gray, smooth shading material, lit using default lighting. Default lighting occurs when no other lights have been placed in the scene. 2 In the perspective view, select the apple stem by clicking its geometry. (Be sure that only the apple stem is selected.) 3 From the Rendering menu set, select Lighting/shading > Assign New Material > Lambert. The Attribute Editor appears for the Lambert material.
6 Click Accept to close the window. 7 In the Attribute Editor, rename the lambert shading material to appleStem_lambert. To create materials for the apple 1 Right-click the apple and select Assign New Material > Blinn from the marking menu. The Attribute Editor updates to display the attributes for the Blinn material. A Blinn material gives the apple a shiny appearance. 2 Click the gray box to the right of Color. The Color Chooser window appears. 3 Click inside the color wheel and drag to a red color.
To create materials for the counter and wall 1 Right-click the background plane and select Assign New Material > Lambert from the marking menu. The Attribute Editor displays the attributes for the Lambert material. 2 Click the gray box to the right of Color. 3 In the Color Chooser window, click inside the color wheel and drag to a light blue color. The color you select in the Color Chooser is applied to the plane. 4 Click Accept to close the window.
The counter, wall, and apple stem all have a matte Lambert surface, while the apple has a shiny Blinn surface. There are many other attributes you can set to change the appearance of these objects, which you’ll explore in the next section. Refining shading materials for objects You can refine the shading materials in the scene to make the objects appear more realistic. In the next steps you connect (or apply) a procedural texture to the counter, and a ramp texture to the apple.
2 To the right of the Color slider, click the Map button The Create Render Node window appears and lists the various textures you can connect to the color attribute of the Lambert material assigned to the counter surface. 3 In the Create Render Node window, scroll through the list of textures, and from the list of 3D Textures, click Granite. The procedural texture gives the counter the look of a stone granite counter top when it is rendered, and provides the context for the scene.
■ In the Color Chooser window, select a beige color and click Accept. NOTE Materials and textures displayed in the perspective view do not show their true appearance. To see the accurate appearance of the texture you must render the scene. To connect a ramp texture to the apple surface 1 Right-click the apple and select Material Attributes from the marking menu. The Attribute Editor updates to display the appleSkin_blinn material properties. 2 To the right of the Color slider, click the Map button.
This texture creates a gradation through a series of selected colors. Applying the ramp texture provides the apple with a realistic variation in surface color. 4 In the Attribute Editor, under Ramp Attributes, change the Type to U Ramp. The Ramp Type indicates the direction of the color gradient. A U ramp applies the gradient in a linear, vertical direction across the object. 5 Add another color component by clicking within the ramp.
6 To change the ramp colors, click the top circular color handle (to indicate which color you want to modify), then click the color box to the right of Selected Color to display the Color Chooser window. 7 Click inside the color wheel and drag to a very dark brown for the first ramp color. Click Accept to close the window. 8 Repeat steps 6 and 7 for the other three ramp colors. For the two middle ramp colors, select a dark red. For the last ramp color, select a deep olive green.
The position of these handles and the corresponding colors affect the location and breadth of the color within the gradient on the apple’s surface. 11 Save your work. In the next section you render your scene to view the textures and materials you’ve assigned to the objects. Maya renderers So far, you’ve seen the results of shading the apple and other surfaces in the scene view. In this view, Maya uses your computer’s graphics hardware to display the shading and textures quickly but with low quality.
Renderer Use Interactive Photorealistic Rendering (IPR) A feature of Maya’s software renderer, used to make interactive adjustments to the final rendered image. You can adjust shading and lighting attributes in real-time, and IPR automatically updates the rendered image to show the effects of your changes. IPR is useful for tweaking an image before rendering to disk.
The following table shows the differences between the Render View and the Scene View: Scene View Render View Display 3D object scene 2D rendered image Surfaces modeled surfaces, the grid, vertices, curves, and object manipulators shaded surfaces only Background default gray background black background by default because only objects with materials that are lit can be seen Quality low-quality, colors and textures do not appear in their final display form high-quality, colors and textures appear
appears or does not appear in the final image. (The left and right borders of the rectangle may be positioned at the edge of the window.) 3 Select Render > IPR Render Current Frame (or select the IPR render current frame button on the Status Line). (By default, Maya uses the Software renderer as indicated on the Render View window’s toolbar.) The Render View appears and displays the rendered image.
The message displayed at the bottom of the IPR Render View window states “Select a region to begin tuning”. In the next step, you create a subregion of the image to render using IPR. 4 In the Render View, select View > Frame Image to resize the Render View window so it fits closely to the rendered image.
NOTE If the region does not update, in the Render Settings window, turn the Raytracing option off. (You won’t alter any other attributes in this lesson. The purpose of the lesson is to learn the process of rendering, not to perfect the results at this point.) 4 From the Render View menu, select IPR > Redo Previous IPR Render. The rendered image updates to the full resolution. By default, the resolution of the IPR window is 320 by 240 pixels.
2 Click the Common tab, open the Image Size section, and select 640x480 from the Presets drop-down list. (An image size of 640 by 480 is four times as large as the 320 by 240 image size.) 3 Close the Render Settings window.
4 Close the Render View window. 5 Select Render > IPR Render Current Frame (or select the IPR render current frame button on the Status Line). The Render View window opens and renders an image with an image size of 640 by 480 pixels. NOTE If you are using Maya on Windows or Linux, rendering the scene displays another window called the Output window, typically behind other windows on your desktop. The Output window lists statistics about the image just rendered.
3 Stop the animation at a frame you want to test render. To test render the current frame of animation 1 In the Render View window, select Options > Render Settings. 2 In the Render Settings window, ensure that Maya Software is selected from the Render Using drop-down list. 3 In the Render Settings window, select the Maya Software tab. 4 In the Anti-aliasing Quality section, select Production quality from the Quality drop-down list.
7 Go to frame 120 of the animation, where the apple is viewed in a different position. 8 In the Render View, select Render > Render > Current (apple_camera). Ensure that the rendered image looks good at this frame also. Now that you’ve checked a pair of rendered frames that represent the entire animation, you are ready to render the entire animation sequence. In your own projects, you might want to test render several frames, particularly where new shading and lighting elements occur in the animation.
including previewing and compositing the animation. If you require a different format, you can specify it instead of .iff in the Render Settings. ■ Frame/Animation Ext: Select name.#.ext. This specifies that the filenames will have the format prefix.frameNumber.fileFormat. For example, batch rendering the entire 200-frame animation will create Apple.0001.iff, Apple.0002.iff, and so on through Apple.00200.iff. ■ Frame padding: Enter 4.
4 Close the Render Settings window. To batch render animation frames 1 Save the scene. It’s a good practice to save the scene before batch rendering. This is useful if, after batch rendering, you need to change any display settings and render again. By saving the scene prior to batch rendering, you can examine the scene to learn which option settings were in effect at the time you batch rendered. 2 From the Rendering menu set, select Render > Batch Render > . The Batch Render Frame window appears.
NOTE For users of Maya Personal Learning Edition, the Use all Available Processors option is disabled. Use the default settings. Batch rendering 50 frames of a simple scene takes a few minutes. A complex scene may take hours per frame, depending on the speed of your computer. To check the status of the batch render 1 While Maya is rendering, select Window > General Editors > Script Editor. Expand the size of the Script Editor window. The window shows a completion log for the frames being rendered.
2 Using the File Browser, navigate to the images directory for your current project (or wherever you saved the rendered sequence of images for the Apple). 3 Click the image file Apple.0001.iff to select the first image in the sequence and then click Open. The FCheck image viewing utility appears and the rendered sequence of 60 frames plays back as an animated loop. 4 Close the window after viewing the animation.
Using IPR There are a few limitations to using IPR for fast visual feedback as you adjust shading and lighting. Besides being unable to provide production-quality anti-aliasing, IPR cannot display several other advanced display characteristics, for example, true surface reflections (raytracing) and 3D motion blur. If an advanced display characteristic seems to be missing from an IPR-rendered frame, try rendering the frame with the software renderer.
appears below the Channel Box by default. For more information, see “Render layers” in the Maya Help. Lesson 2: Shading surfaces Introduction In the real world, objects are seen in specific ways based on the following: ■ The materials they are made of. ■ Their surface textures. ■ How they are lit and reflect light. ■ The environment surrounding them. In Maya, you provide your surfaces and objects with these characteristics by assigning shading materials to them.
involves such attributes as color, transparency, shininess, and many others to create a realistic look. Editing the material attributes associated with shading materials affects how they appear in the rendered image. In this way, Maya provides the option of allowing you to create images as they would appear in the real world or in your imagination. In this lesson, you learn to use basic shading features to render a sphere so it appears like an orange in the final image.
The scene’s perspective view also has two settings turned on—Shading > Smooth Shade All and Shading > Hardware Texturing (Hotkey: 6)—which let you see the shading changes you are about to make. Assigning a shading material In the next steps, you create a material and assign it to the surface. A material is a collection of attributes that define color, shininess, and other surface characteristics.
4 In the Color Chooser, click inside the color wheel (hexagon) and drag the pointer to an orange-colored area, as illustrated. The sphere becomes the same color you select in the Color Chooser. Also drag up the slider to the left of the hexagon to get a brighter shade. 5 Click Accept to close the Color Chooser. If you compare the color in the Color attribute box with the sphere’s color in the scene view, you’ll notice a difference. The color you assigned is only one aspect of surface appearance.
In practical usage, the Diffuse setting makes a surface appear brighter. The name diffuse comes from a property in physics that describes how light spreads after it strikes a surface. A surface with a high diffuse property spreads the light that strikes it, making the object appear brighter. Like the Diffuse attribute, the other Common Material Attributes also refer to general characteristics of light and the way a surface reacts to light.
As you work with shading, you’ll find many attributes that have no effect in the scene view, for instance, Ambient Color and Translucence. Generally, the scene view is a rough approximation of how the scene will render. The IPR renderer is ideal for testing shading. It shows the results of all changes you make to shading and shows them immediately. There is only one attribute change the IPR renderer does not show—reflectivity. See the next step for details.
Your settings for the Color and Diffuse attributes are maintained because they are common to all material types. The Specular Shading and all other attribute settings do not convert when you change the material, so it’s best to choose your material before you make many changes. 2 In the Specular Shading section, you can leave Roughness and Highlight Size at the default settings. The default highlight settings give the orange a waxy look.
In the Maya Help, a texture is also referred to as a texture node. A node is a collection of attributes (or actions) with a common purpose. A shader is sometimes called a shader node or material node. To display a texture on a surface, you apply a texture node to an attribute of the surface material. In the next steps, you apply a texture to the Color attribute of the Phong E material. To apply a texture to a material 1 Click the Map button next to the Color slider.
The Normal option means Maya will stretch the texture evenly around the surface. The other settings—Projection and Stencil—are other ways you can apply a texture. You will learn about these settings at the end of the lesson. 3 In the 2D Textures list, click the File button once. At this point the system may prompt you with the warning that “The IPR file does not have enough information to support your most recent change”. Select “Close the IPR file and stop tuning”.
If you select another object and the Attribute Editor no longer displays the file texture attributes, it’s easy to restore the display. Right-click the sphere, select Material Attributes, and click the texture map icon next to the Color attribute. 8 As an example of the place2dTexture1 placement controls, move the Rotate UV slider slightly to the right, to a value about 5.9. This rotates the Mayakist logo on the surface. In this case, the texture placement needs almost no adjustment.
This tab shows all the materials currently in your scene. It is especially useful when you have a complex scene and you need to locate a material to edit it. The materials you will recognize are the default Lambert material and the Phong E material. You can ignore the others. They exist in all scenes, by default, for use with other Maya features. In addition to the Materials tab, Hypershade includes other tabs to help you keep track of textures, lights, and other nodes related to rendering.
This graph shows all material and texture nodes applied to this object. While the Materials tab shows a catalog of the materials in the scene, the Work Area tab shows whatever material, texture, or other node you are currently working on. The Graph menu has several menu items that change the contents of the Work Area display. The Shader Library tab shown in the above illustration might not be a part of your Maya installation. It is an optional feature, discussed at the end of this lesson.
8 Select Edit > Undo (see Edit > Undo, Redo, Repeat) to restore the file texture connection you deleted. 9 In Hypershade, right-click the center of the phongE1 swatch and select Rename. 10 Type: Orange. Renaming is not as important in this scene as it would be in more complex scenes with several materials. The Rename operation is one of several useful menu items that appear when you right-click a material swatch. Another handy menu item is Assign Material to Selection.
To create a bump texture within the Hypershade Editor 1 In the Create bar, scroll down to the 3D Textures heading. For this bump effect, you use a Brownian 3D texture. Experience has shown that a Brownian texture is the best texture for approximating the bumps on an orange skin. Becoming skillful with textures is a matter of observation, experimentation, and experience.
Also notice that bumps from the bump map appear in the Orange material’s swatch. The Orange material swatch is the same as the Material Sample that appears in the Attribute Editor for the material node. (The bumps also appear in a rendered image, but not in the scene view.) 5 Double-click the bump3d1 swatch (the checkered cube) to display its attributes in the Attribute Editor. This node is the link between the texture and the material.
Our recommendation for these values is based on experimentation. For Brownian and some other textures, it’s usually faster to get desirable results by experimenting with the settings rather than trying to understand the definition of each attribute. Modifying a bump texture The bump texture is too crater-like to be a convincing orange. The bumps are too numerous and too deep. A quick way to fix this problem is to scale up the entire texture.
3 In the scene view, click on the center scale box to activate the center scale option. Scale the whole texture placement cube to about twice the original size (until the Scale attribute values are about 2). Now when you render, the bumps on the surface appear wider and smoother, like the bumps on an orange skin. For example, the bumps in the area surrounding the highlight do not appear to be as deep as they were before you scaled the texture.
NOTE If you have tumbled the camera for a different view of the orange or the texture placement cube, ensure you reposition the camera so that the orange’s Mayakist logo is visible before rendering again. Otherwise, the rendered image will appear incorrect. In the rendered image, notice that the bumps still remain on the sphere. Objects do not need to be within the texture placement cube, because it represents an imaginary texture volume, which is infinite.
■ Textures can be applied to a shading material to enhance the realism of the final image. For example, logo graphics, bumps, and so on, can be added to enhance the detail on the surface. ■ Textures can be 2D or 3D in nature. Each has its unique techniques for application and placement. Placement of textures When you put the Mayakist logo on the surface, the letters appeared straight. The letters are actually skewed in the texture.
other textures and control how they blend together. For example, the bottom layer could be the logo image you used in the lesson, and a top layer could be an image of streaking lines that resemble scars. The combined logo and scars would give the orange the final aged look that you wanted. Shader Library As an option, you can install a Shader Library with Maya to help you quickly create common materials, such as bricks, fabrics, foods, and many other surface types.
Lighting and camera techniques are one of the most crucial aspects to consider when working with artificial characters and objects. The more realistic the lighting and shading appear, the more convincing the scene will appear to the viewer. A prerequisite to creating effective 3D rendered animation is to study the lighting and camera effects used in live-action film. Your goal is to create the desired scene ambience while keeping the lights and camera view as unobtrusive as possible.
When you open the scene, Maya lights the scene with default lighting provided by an imaginary light fixture. It emanates light infinitely from a point above and behind the active scene view camera. There is no icon that represents the default light in the scene view. Directional lights Maya has many types of lights that simulate natural and artificial lighting. In the next steps, you create a light for the scene using a directional light.
When you create a light, the scene view does not display its effect, by default. The scene view instead uses default lighting. 3 Select Lighting > Use All Lights (Hotkey: 7). This lights up the scene view only with lights you’ve created, not with default lighting. If you later want to see the scene view with default lighting again, select Lighting > Use Default Lighting (Hotkey: 6). When you render the scene, by default, Maya uses all lights you’ve created.
4 In the Attribute Editor, click the white Color box above the Intensity box. This displays the Color Chooser. 5 Click inside the color wheel (hexagon) and drag the pointer to a red color. The lighting imparts a red hue to the surfaces in the scene. 6 Change the color back to white and set the Intensity to 1.2 or so. You’ll use these settings for the basic lighting of the scene. Spotlights In the next steps, you light part of the desk by creating a spotlight and positioning it within the desk lamp.
If you look at the spotlight icon from several angles, you’ll notice that it is shaped like a cone with an arrow pointing out of it. The cone symbolizes that a spotlight emits a beam of light that gradually widens with distance. 4 Select Modify > Transformation Tools > Show Manipulator Tool (see Modify > Transformation Tools > Move Tool, Rotate Tool, Scale Tool, Show Manipulator Tool). With the spotlight selected, this tool provides two manipulators that you can move to position and aim the light precisely.
You can also use the Rotate tool to center the eye-point more accurately in the lamp housing. An alternative way to position a spotlight is to select the light and then select Panels > Look Through Selected. You can then dolly and pan the view to focus on the desired surface. The area of focus is where the light strikes the surface. To return to the perspective view select Panels > Perspective > persp.
By turning on Use Depth Map Shadows, the spotlight’s lighting is blocked by the first surface it hits (the desk). The floor is in the shadow of the desk so it receives no light. You’ll learn more about Depth Map Shadows later in the lesson. If you were to render the scene with IPR rather than the software renderer, the image would not automatically remove the lighting of the spotlighting from the floor when you turn on Use Depth Map Shadows.
3 Set Dropoff to 10. This attribute sets how much the light intensity diminishes from the center of the circular region out to the edge. Finding the right value is a matter of experimentation. When you increase the Dropoff, the light’s intensity diminishes, so you need to increase the Intensity. For example, increase the Intensity to 1.6.
inward from the circle’s edge. The viewing angle of the camera influences the appearance of the fading at the edge. Rendering creates this result: 5 In the Light Effects section of the Attribute Editor, click the map button to the right of the Light Fog box. This gives the appearance of the light beams illuminating fog or dust in the air. Rendering creates this result: Fog is more noticeable when you view (render) the light beam from a side angle rather than from above the light fixture.
The icon displays the region of the potential illumination. You won’t see light fog under the table. The table blocks the light fog because you previously turned on spotlight’s Depth Map Shadows attribute. You can use the Scale tool on the icon to expand or contract the region of the illumination effect. Shadows Shadows are the darkened areas that appear on a surface when an object gets in the path of a light source. Shadows are cast onto the area of a surface that doesn’t directly receive light.
Depth Map Shadows refers to the algorithm Maya uses to produce shadows. For basic shadowing, you don’t need to know about the algorithm, but you do need to make sure you turn on Use Depth Map Shadows. 3 To sharpen the shadow’s edges, open the Attribute Editor’s Shadows section and then the Depth Map Shadow Attributes section. Set the Resolution to 1024. Rendering creates this result: Increasing the shadow’s resolution increases rendering time.
If you are intent on perfecting shadows in your future projects, try various combinations of values for Resolution and Filter Size. For this lesson, the default values are satisfactory because the shadow edge has minimal contrast. If you create shadows with sharp contrast at the edges, altering the default values will be more desirable.
With a camera selected, the Show Manipulator Tool provides the same two manipulators that you used to position the spotlight: eye point and look-at point. The look-at point sets where the camera aims. The eye point sets the position of the camera. You can select the current camera by selecting View > Select Camera. 4 Select Panels > Perspective > myCamera to view the scene from myCamera.
Animating camera moves In Maya, the camera can be animated. You can set keyframes for the camera moves the same as for other objects in your scene. In the next steps, you set keys to do a simple animation of the camera’s movement. To animate the camera 1 Go to the start of the playback range. 2 Dolly, tumble, and track myCamera to create a view similar to this: 3 With myCamera selected, set a key for the camera’s current view at the first frame.
4 Go to frame 150. 5 Dolly myCamera to create a view similar to this: 6 Set another key. 7 Play the animation to see the camera dolly toward the table for the first 150 frames. At this point, feel free to experiment with keying changes in the view resulting from tumbling and tracking the camera. Excessive animation of tumbling and tracking creates a dizzying effect that is a common mistake of inexperienced artists.
spotlight. Because the face and the wall are near each other, all the spotlights currently strike both objects. You can use Maya’s light-linking capability to isolate the lighting. ■ Create shadows in the scene by having the lights cast shadows. The Maya software renderer has two types of shadows: Depth Map Shadows and Ray Traced Shadows. In this lesson, you created Depth Map Shadows, which are less realistic than Ray Trace shadows but much faster to render.
Lesson 4: Global Illumination Introduction The mental ray® for Maya® renderer can render using a feature called Global Illumination. Global Illumination simulates the effect of all lighting and inter-reflection in the scene, whether the items are lit directly by a light source or indirectly illuminated by other objects (and diffuse sources of illumination in the scene).
The Global Illumination feature in the mental ray® for Maya® renderer simulates this effect and provides for a realistic illumination simulation in your Maya scenes. In this lesson you learn how to: ■ Differentiate between images made with Global Illumination compared to other lighting types. ■ Render an image using Global Illumination by performing repeated test renders to achieve a final result which includes: ■ ■ Lighting a scene using the mental ray Global Illumination attributes.
The scene contains a still life with a fruit bowl. Other surfaces act as the floor and walls for the scene. The primary light source is a spotlight. The spotlight casts light through a vertical opening in the wall. Some areas in the scene are directly lit and other areas are not. Shading materials have already been assigned to the bowl, fruit, and other surfaces. The apple and orange models are from the previous lessons.
To change the renderer to mental ray for Maya 1 In the main menu, select Window > Rendering Editors > Render Settings (or click the Render Settings icon on the Status Line) to display the Render Settings window. 2 In the Render Settings window, set the Render Using setting to mental ray. When you render an image it will now use the mental ray for Maya renderer.
The Draft setting ensures low anti-aliasing settings are used and reduces the rendering time compared to other preset settings. This is a good practice when evaluating the lighting and basic material properties in your test renderings. Setting the image size for rendering You set the size that an image is rendered in the Render Settings window. For this lesson, you render the image at a size that allows you to evaluate the Global Illumination effect.
Turning on shadows Shadows add realism to a scene, and in this lesson, help to demonstrate how a scene rendered using Global Illumination differs from a scene rendered using direct illumination. To turn on shadows for the spotlight 1 Open the Hypershade window (Window > Rendering Editors > Hypershade) and click on the Lights tab to display the lights in the scene. The scene is lit with one spotlight named spotLightShape1.
To render an image using mental ray for Maya 1 Click in the perspective window. This indicates which camera view you want Maya to render. 2 On the Status Line, click the Render Current Frame icon to launch the renderer to produce an image. The Render View window appears and the fruit bowl scene renders using the mental ray for Maya renderer. 3 Once the render is complete, click the Keep Image icon in the Render View window to save this image.
Render the scene using Global Illumination To render using Global Illumination you need to turn on specific settings or attributes. There are two areas that you must initially set. ■ Turn on the Global Illumination rendering attributes using the Render Settings Window. ■ Turn on the Global Illumination lighting attributes using the Attribute Editor.
To turn on Global Illumination lighting attributes 1 Open the Hypershade window (Window > Rendering Editors > Hypershade) and click on the Lights tab to display the lights in the scene. 2 In the Hypershade, double-click on the icon for spotLightShape1 to display the attributes for the spotlight. 3 In the Attribute Editor, click the spotLightShape1 tab to display the lighting attributes for the spotlight.
2 From the perspective view’s panel menu, select Panels > Saved Layouts > Hypershade/Render/Persp. The panel layouts update to display the Hypershade window, Render View window, and Perspective view simultaneously. This allows you to easily work with these windows without having to open and close them repeatedly. If the image in the Render View window appears pixelated as a result of the new panel layout, do the following: ■ In the Render View window menu, select View > Real Size.
3 Visually compare this rendered image with the previously rendered images. In this rendering, the shadow areas of the scene appear less dark as a result of Global Illumination. The bowl also appears more transparent than in the previous rendering. The effect you want to achieve is to have the shadow regions receive indirect light; that is, you want to be able to view more detail in the shadow areas as a result of the Global Illumination.
3 In the Caustic and Global Illumination attributes adjust the settings to the following: ■ Photon Intensity: 120000 Increasing the Photon Intensity increases the illumination in the areas affected by Global Illumination. To render the scene 1 In the Render View window, click the Redo Previous Render icon to render the image. 2 When the image has completed rendering, click the Keep Image icon to save the image. 3 Compare this rendered image with the previously rendered images.
In the next steps, you return to the Render Settings window and the Attribute Editor to increase the quality attributes that affect the Global Illumination effect. To increase the Global Illumination quality settings 1 In the Render Settings window, click on the Indirect Lighting tab and expand the Global Illumination section. Change the following Global Illumination attributes to: ■ Accuracy: 900 ■ Radius: 2.
When the Accuracy and Radius values are increased, the resulting rendered image shows the circular spots have almost fully disappeared and the Global Illumination is much more uniform when compared to the previous rendering. Increasing the number of Global Illumination photons should aid in making the Global Illumination more uniform. In the next steps, you increase the number of photons to provide a more uniform Global Illumination in the scene.
2 When the image has completed rendering, click the Keep Image icon to save the image and compare this rendered image with the previously rendered images. In this image, the circular spots that were seen in the previous renderings have disappeared.
■ Number of Samples - Max sample level: 1 Sampling is the process for determining the amount of anti-aliasing that occurs. The Sample Level attribute sets minimum and maximum limits for the amount of sampling that will occur for a given pixel area in the image. Modifying the anti-aliasing Sample Level settings will ensure that the surfaces in the rendered image appear smooth. A Max value of 1 should provide the correct amount of anti-aliasing sampling for this particular image at this image size.
Beyond the Lesson In this lesson you were introduced to the Global Illumination features provided by the mental ray® for Maya® renderer. You learned that: ■ The mental ray for Maya renderer provides a feature that simulates indirect illumination in the Maya scene called Global Illumination. ■ Global Illumination allows you to achieve realistic lighting effects for objects and areas of the scene that do not receive direct lighting.
Visualizing the photon mapping can aid in determining whether the coverage and density of photons for the scene is appropriate for the resulting final image. By default, the mental ray for Maya renderer rebuilds the photon map each time you render a scene using Global Illumination.
Lesson 5: Caustics Introduction Caustics are the light effects and specular patterns that are cast on surfaces as a result of focused light reflecting off highly reflective surfaces or refracting through translucent surfaces. The light patterns that occur on the bottom of a swimming pool on a sunny day, or the bright areas that occur in the shadow of a glass object as light shines through it are examples of caustics.
■ Systematically perform test renders and adjust the render and caustic quality settings in order to achieve a high quality image. Open the scene for the lesson In this lesson, you work with a scene we created for your use. In the first steps of this lesson, you open the scene and view the various elements that have been preset for your use. 1 Make sure you’ve done the steps in Preparing for the lessons on page 439. 2 Open the scene file named CausticStart.mb.
Render the scene using raytracing To better understand the differences between caustics versus other lighting, you begin by rendering the scene using the mental ray for Maya renderer without using Caustics. You start by preparing the scene and then rendering.
The panel layouts update to display the Hypershade window, Render View window, and Perspective view simultaneously. When you render an image, it appears in the Render View window. TIP You can resize the panels in a preset layout by dragging the border between neighboring panels using your left mouse button. Turning on shadows In this lesson, you learn how the bottle’s shadow can be made to appear more realistic as a result of the caustics.
4 In the Shadows section, open the Raytrace Shadow Attributes and turn on Use RayTrace Shadows. When you render the scene, shadows are cast by the spotlight. 5 Hide the Attribute Editor by clicking the Show/Hide Attribute Editor icon on the Status Line. Using the mental ray for Maya renderer To use the Caustics feature in Maya you must render using the mental ray for Maya renderer.
Setting the image size for rendering You set the size that an image will be rendered in the Render Settings window. For this lesson, you render the image at a size that allows you to evaluate the caustic effect. To set the image size for rendering 1 At the top of the Render Settings window, select the Common tab and open the Image Size settings. 2 Choose the 640 X 480 preset from the Presets drop-down list.
Rendering the image When you render an image, all of the objects, lighting, shading materials, and image quality settings are used to calculate the image, from the camera’s view. To render an image using mental ray for Maya 1 Click in the perspective window to indicate which view you want to render. 2 In the Render View window, click the Render Current Frame icon. The bottle scene renders using the mental ray for Maya renderer and the image appears in the Render View window. .
The rendered image shows the following: ■ A translucent bottle with apples beside it casting shadows towards the rear of the scene. Notice how the shadows appear when raytrace rendered. ■ The distortion of the table surface in the translucent glass effect based on the refractions and reflections. ■ A dark region on the surface of the bottle. This results from the bottle reflecting the empty black area of the scene in front of it.
illumination that results from this photon emission in a file called a photon map. The overall caustic simulation is determined from the photon calculations that result. In addition to having the spotlight emit light into the scene you set the light to also emit caustic photons. The overall caustic effect is determined from the photon calculations that result. To turn on the caustics lighting settings 1 In the Hypershade, double-click on the icon for spotLightShape1.
To render the scene using caustics 1 In the Render View window, click the Redo Previous Render icon. 2 When the image has completed rendering, click the Keep Image icon. 3 Compare this rendered image with the previously rendered image by dragging the scroll bar at the bottom of the Render View window left and right. This image differs from the previous one in the following ways: ■ The bottle appears more opaque. This indicates that the correct number of refractions may not be occurring.
Increasing the Refractions setting allows the renderer to calculate what is seen through the surfaces of the glass by allowing the light rays to refract the correct number of times. In the next step, you change the Refraction settings so that the bottle will appear translucent when rendered. To increase the refraction levels 1 In the Render Settings window, select the Quality tab and then open the Raytracing attributes.
Increasing the brightness of caustics Increasing the Photon Intensity setting increases the brightness of the refracted caustic that appears in the shadow of the bottle. To increase the Photon Intensity 1 In the Hypershade window, double-click the icon for spotLightShape1 to display the attributes for the spotlight.
area of illumination. (If you have previously completed the Global Illumination tutorial, you may notice similarities in this area.) In the next steps, you return to the Render Settings window and the Attribute editor to increase the quality attributes that affect the caustics effect. To increase the caustics quality settings 1 In the Render Settings window, open the Caustics and Global Illumination attributes and change the following Caustics attributes to: ■ Accuracy: 900 ■ Radius: 1.
2 In the Caustic and Global Illumination attributes, adjust the following settings: ■ Caustic Photons: 50000 3 In the Render View window, click the Redo Previous Render icon. 4 When the image has completed rendering, click the Keep Image icon and compare this rendered image with the previously rendered images. In this image the bright spots in front of the bottle should be reduced when compared to the previous images.
■ The quality of the caustic effect is controlled by the number of photons emitted into the scene, the Accuracy, and the Radius attributes. ■ Multiple test renders are often required to achieve the desired final image. Light sources for caustics Point, spot, and mental ray area lights can be used as light types for caustics with the mental ray for Maya renderer.
534
Dynamics 10 Introduction Dynamics is a branch of physics that describes how objects move using physical rules to simulate the natural forces that act upon them. Dynamic simulations are difficult to achieve with traditional keyframe animation techniques. Maya provides a means to do this type of computer animation where you set up the conditions that you want to occur, then let the software solve how to animate the objects in the scene.
2 If you have not already done so, copy the GettingStarted folder from its installation location to your projects directory. Then, set the GettingStarted directory as your Maya project. For more information, see Copying and setting the Maya project on page 25. 3 Select Window > Settings/Preferences > Preferences. Click Timeline under Categories and make sure the Playback Speed is set to Play every frame. Dynamic animation plays more accurately with this setting. 4 Select the Dynamics menu set.
■ Work with particle attributes. ■ Color particles. ■ Use a color ramp to add colors to the particles. ■ Render the particles using hardware rendering. Creating an emitter Emitters create particles as an animation plays. The emitter controls the position, direction, quantity, and initial velocity of the emitted particles when they are born. After particles are born, the attributes of the particle object control their appearance.
With Radius set to 4, the circle will be wide enough to see the particle emission clearly. With Number of Sections set to 25, the emission will be distributed evenly from points around the circle. Note that the illustrations in this chapter show the grid with a custom blue color and numbered lines so that the shape and size of the objects you create are easier to distinguish. (If you want to change the grid color in your scene, select Display > Grid > .
6 Display the Outliner (Window > Outliner). 7 In the Outliner, select particle1. This is the particle object. A particle object is a collection of particles that share the same attributes. You can create particle objects containing a single particle or millions of particles. Each particle in a scene belongs to some particle object. The particle object’s attributes define the appearance and other characteristics of the emitted particles.
axis within the volume.
You’ll typically need to experiment with various Volume Axis field attribute values to achieve a desirable motion for particles. Be aware that small arrow-shaped icons within the Axis Field icon show which direction the particles will go.
When the particles move out of the conical region, they continue in the same direction, mirroring the pattern of movement within the conical region. The volume axis field no longer controls the motion, but the particles continue with the same speed and direction they had at the moment they exit. To create a torus volume axis field 1 In the Outliner, select the particle object 2 From the main menu, select Fields > Volume Axis > .
Section Radius defines the thickness of the torus. A value of 2 for Around Axis causes the particles to swirl around the central axis. For a torus, the central axis is the ring in the center of the solid part of the torus. A value of -0.7 for Away From Axis causes the particles to move radially toward the central axis. When you later play the animation, the combination of these values cause the particles to loop up then down as if guided along the inner walls of a torus.
and other small icons within the axis volume field to help get the desired results. Note that the field’s effect is pervasive enough that all particles passing through the hole of the torus are influenced by the field. You can cause particles to pass through the hole by altering the Max Distance and Attenuation. 4 With the torus volume field still selected, enter the following values in the Channel Box: ■ TranslateY: 15 ■ ScaleX: 3.6 ■ ScaleY: 3.6 ■ ScaleZ: 3.
Adjusting the velocity of moving particles The torus volume axis field doesn’t guide the motion of the particles as expected because the initial emission velocity of the particles dominates the motion of the particles rather than the field. You can use a particle object’s Conserve attribute to scale down the emission velocity’s influence and increase the field’s influence. To adjust the velocity of moving particles 1 Select the particle object and set the Conserve attribute to 0.8 in the Channel Box.
the particle render type, you can add attributes specific to the render type to adjust the appearance. To set the particle render type 1 With the particle object still selected, display the Attribute Editor, and select the particleShape1 tab. 2 Scroll down to the Render Attributes section, and set the Particle Render Type to Streak. 3 Go to the start of the playback range and play the animation. The Streak render type displays moving particles with an elongated tail.
To add dynamic attributes 1 In the Attribute Editor, under the Render Attributes section, click the Current Render Type button next to Add Attributes. 2 Observe the attributes that are added. 3 Set the following attributes: Line Width 2 This sets the width of each streak. Tail Fade 0.5 This sets the opacity of the tail fade; it can range from 0 to 1. A value of 1 makes the tail completely opaque; a value of 0 makes the tail transparent. Tail Size 2 This scales the length of the tail.
Adding per particle attributes Particle objects have two different kinds of attributes: per object and per particle. A per object attribute lets you set the attribute value for all particles of the object collectively with a single value. For instance, the per object color attribute lets you set a single color for all the particles in the object. A per particle attribute lets you set the value of the attribute individually for each particle of the object.
Adding color to particles with a color ramp A ramp texture is a patterned 2D image in which the color blends from one shade to another. In the next steps, you use a color ramp to color the particles as they age. To add color to particles using a color ramp 1 In the Attribute Editor, right-click the rgbPP data box and select Create Ramp from the drop-down menu.
This is because the Lifespan is set to the default of 1, which is the number of seconds the particles exist in the animation. 4 In the Channel Box, set Lifespan to 3. Go to the start of the playback range and play the animation. Because the particles live longer, they pass all the way through the cone and part of the way through the torus. The particles change from red to green to blue and disappear as they are born, age, and die.
Hardware rendering particles In 3D animation, rendering typically refers to the act of creating a sequence of high-quality image snapshots for each frame of an animation sequence. After rendering the images, you play them in sequence to create a film or video clip. If the concept of 3D animation rendering is new to you, consider doing the lesson Lesson 1: Rendering a scene on page 439 before completing this section.
4 In the Hardware Render Buffer window, select Render > Attributes. The Attribute Editor appears. 5 In the Attribute Editor, under the Render Modes section, turn on Line Smoothing. This softens jagged edges when you hardware render Streak or MultiStreak render types. 6 To see the softened edges, select Render > Test Render. If you click in the Hardware Render Buffer window, the rendered image disappears. If this occurs, select Render > Test Render again to redisplay the image.
5 To play the hardware-rendered sequence, select Flipbooks > Emit.1-75. 6 Close the FCheck image viewing window when you are finished examining the animation. Beyond the lesson In this lesson you were introduced to a few of the basic concepts when using particles. You learned how to: ■ Create particles from a source object called an emitter. When you create any type of emitter, a particle object is also automatically created and connected to it.
Lesson 2: Rigid bodies and constraints Introduction In Maya, a rigid body is a surface which has the attributes of an unyielding shape. Unlike conventional computer surfaces, rigid bodies collide rather than pass through each other during animation and are used for creating dynamic simulations. As well, rigid surfaces do not deform when they collide with other objects in Maya. Rigid bodies can be created from polygonal or NURBS surfaces.
2 In the Time and Range Slider, set the start frame to 1 and end frame to 200. 3 Select Create > Polygon Primitives > Cube > . 4 In the Polygon Cube Options window, select Edit > Reset Settings (to make sure the tool is set to its default, and then set the following options and click Create: ■ Width : 2 ■ Height: 4 ■ Depth: 0.25 ■ Axis: Z 5 With the polygon still selected, select Edit > Duplicate Special > . 6 In the Duplicate Special Options window, select Edit Reset Settings.
■ pCube2 - Translate Z: 2 ■ pCube3 - Translate Z: 0 ■ pCube4 - Translate Z: 2 ■ pCube5 - Translate Z: -1 ■ pCube6 - Translate Z: 1 Creating hinge constraints A Hinge constraint constrains rigid bodies along a specified axis. You can use a Hinge constraint to create effects such as a door on a hinge, a link connecting train cars, or a pendulum of a clock. In this example, the Hinge constraint constrains the plank to a position in the scene view.
By default, the initial orientation is set to 0, 0, 0, which orients the hinge constraint to lie parallel to the Z-axis in world space. By setting the orientation to 90 in the Y-axis, the hinge constraint is rotated 90 degrees around the Y-axis, which orients the constraint parallel to the X-axis. By leaving the Set Initial Position at its default setting, the hinge constraint is created at the rigid body’s center of mass. 3 Select pCube1 and click Apply in the Constraint Options.
The ball falls and collides with the planks, which rotate about the hinge constraint. Changing an active rigid body to passive Maya has two kinds of rigid bodies—active and passive. An active rigid body is animated by dynamics—fields, collisions, and springs—not by keys. Because the ball and planks are all active rigid bodies, gravity pushes it down and it rebounds after colliding with the planks. A passive rigid body can have active rigid bodies collide with it.
Beyond the lesson In this lesson you learned some fundamental concepts with respect to rigid body dynamics. ■ There are differences between active and passive rigid bodies. When a rigid body is passive, active rigid bodies can collide with it but will not move it. You can control its movement by setting keys. When a rigid body is active, you control its movement using dynamic forces, specifically fields and collisions.
560
Painting 11 Introduction Maya provides painting tools that go above and beyond what many 3D creative artists might normally envision. These tools allow you to accomplish a wide range of modeling, animation, texturing, and effects work. The painting tools are separated into three categories: Maya® Artisan™ brush tools, Maya® Paint Effects™ tools, and 3D Paint. If you completed the previous lessons in Getting Started with Maya, you already have experience with a few of these tools.
■ In the Character Setup chapter, you used Artisan brush tools to modify the skin weights on a surface mesh to ensure the character’s joint deformed properly. ■ In the Character Setup chapter, you used the Artisan brush tools to modify the cluster weights for Control Vertices to ensure a blend shape deformer worked predictably. As you have seen, Artisan brush tools can also be used to select surface components. This selection method can dramatically improve the speed of your workflow.
GettingStarted directory as your Maya project. For more information, see Copying and setting the Maya project on page 25. 3 Select File > New Scene to create a new scene. 4 To use all available screen space, maximize the Maya window. 5 From a panel menu bar, select Panels > Layouts > Single Pane. 6 Select the Rendering menu set. Unless otherwise noted, the directions in this chapter assume the Rendering menu set is selected.
Painting strokes In the following steps, you display the 2D canvas and use preset brushes to paint a few strokes. Although not covered in this lesson, you can use a tablet and stylus to paint with pressure sensitivity. The harder you press down, the more paint is applied. To paint strokes on the 2D canvas 1 Do the steps in Preparing for the lessons on page 562.
TIP You can dolly and track the canvas using Maya’s standard mouse and keyboard conventions. 6 Now paint with various preset brushes. To select a preset brush, select Brush > Get Brush or click the following button in the toolbar: The Visor window opens. The Visor organizes the hundreds of Paint Effects brushes into category folders. In the Visor, click a folder, then click a brush icon in the area to the right of the folders. (The name of each preset brush has the extension .
When you paint a stroke slowly, the density of flowers is higher than when you paint quickly. The effect of stroke speed on density works the same for all brushes that use tubes. 2 To erase your last stroke, select Canvas > Canvas Undo. When displaying the 2D canvas, you can undo only a single stroke. Edit > Undo, Redo, Repeat (on the main menu) doesn’t undo strokes.
5 Close the Paint Effects Brush Settings window. 6 On the toolbar, click the swatch to the right of C (color) to display the Color Chooser. 7 Select a color from the Color Chooser and paint on the canvas. 8 On the toolbar, slide the T (transparency) slider to the right until the T box is a light gray. Paint on the canvas. When you paint over existing paint strokes you will notice that your paint is transparent allowing the previous strokes to show through.
Modifying the canvas In the next steps you change a few canvas options, including color and size. To modify canvas settings 1 Clear the canvas (Canvas > Clear). 2 Select Canvas > Set Size and set the canvas size to 512 x 512—the width and height in pixels. When you are prompted to save, click No, then close the Set Canvas size window.
TIP When using the fern.mel brush, if any of the sliders do not appear, or appear cut off on the right, you need to increase the screen display resolution setting on your monitor to 1280 X 1024. To change the color of a brush 1 In the Visor (Brush > Get Brush), click the fern.mel preset brush in the plants folder. 2 Paint on the canvas to see the default display. Because fern.mel uses tubes, ferns grow along the path of your stroke. 3 Resize the brush to a Global Scale of about 0.
8 Clear the canvas (Canvas > Clear). Editing strokes with tubes attributes Now you’ll edit the attributes that specify the foliage that grows along the path with fern.mel. To edit tube attributes 1 To edit brush settings, select Brush > Edit Template Brush. 2 Open the Tubes section, then open Growth. By default, only Leaves and Buds are created as you paint. You can also create Branches, Twigs, and Flowers to simulate a fern in various stages of its natural life cycle. 3 Turn on Flowers.
5 To make the flowers point in a different direction, open the Behavior section and then the Forces section. Set Path Follow to 0.1. 6 Paint to see the result. Saving brush settings for future use When you first selected the preset brush fern.mel previously, Maya copied it to the template brush. You then edited the color and various other attributes of the template brush to create a unique ferns brush. The next steps show how to save the current settings of the template brush for future use.
4 Click Grab Icon and drag a selection box around a part of the image that is representative of the brush’s result. A swatch appears in the window for the selected region. Repeat this step until you are satisfied with the icon. 5 Click Save Brush Preset. An icon for the new preset brush appears on the Shelf. 6 To check that the blueFern brush works, select a different preset brush and paint on the canvas, then select the blueFern from the Shelf and paint on the canvas.
If the Brush Preset Blend window is open, each time you select a preset brush, its Shading and Shape values will be blended with the template brush. 6 Close the Brush Preset Blend window when you are done blending brushes. 7 Do not clear the canvas. You’ll use your existing strokes in the next steps. Smearing, blurring, and erasing paint Now you’ll work with brush types that smear, blur, and erase paint. To smear, blur, and erase paint 1 Select Brush > Reset Template Brush to select the default brush.
White regions represent full opacity. Black represents full transparency. 4 If you turned on the alpha channel (Display > Alpha Channel), return to the display of full color by selecting Display > All Channels. 5 Clear the canvas and restore the canvas color to white (Canvas > Clear > ). 6 To quit the canvas display and return to a scene view, select Panels > Perspective > persp (Hotkey 8). 7 In the Toolbox, click the Select Tool.
■ Edit, blend, and save preset brushes for later use. Painting on the 2D canvas is useful when you need to create a texture to be applied to a surface. For example, suppose you paint a repeating brick pattern on the canvas and save the canvas as an image file. You can create a material, for instance, a Blinn material, then apply the image file as a file texture to the color of the Blinn material. You can then apply the Blinn material to a 3D wall you’ve modeled, which creates the illusion of a brick wall.
metal, flowers, trees, and underwater etc.) can be used to create 3D objects in your scene. For example, you can use the preset plant brushes to paint a 3D tropical fern garden around a walking character in your scene. You can animate brush strokes to create dynamic effects. For example, you can animate the ferns to shake in the wind or have them move when a character walks near them. An electronic tablet with stylus is an ideal tool for painting with Paint Effects.
If you just finished Lesson 1 in this chapter you may be presented with a window asking if you wish to Save previous paint effects. Select No. 3 To use all available screen space, maximize the Maya window. 4 From a panel menu bar, select Panels > Layouts > Single Pane. 5 Select the Rendering menu set. Unless otherwise noted, the directions in this chapter assume the Rendering menu set is selected. 6 From the Shelf, select the Paint Effects tab to display the various preset brushes.
2 From the Shelf, select the Paint Effects tab to display the Paint Effects preset brushes. 3 From the Paint Effects shelf, select the Daisy Large Brush. In the scene view, the cursor changes to a red circle with a vertical line indicating it is set to paint a stroke. The circle indicates the width of the brush path. With some types of strokes, this path will appear as the width of the actual paint; with other stroke types, it indicates the width of the tube seeding path, for example, plants, trees, etc.
By default, the brush cursor moves along the ground plane. The ground plane lies in the X, Z dimension. This is the default behavior for the brush cursor. If you draw a paint stroke, it is applied to the ground plane (X, Z). To paint 3D strokes in the scene view 1 With the Daisy Brush selected, draw one short paint stroke on the ground plane using one of the following methods: ■ Drag the stylus across the tablet while exerting slight pressure on the stylus as you move it.
The stalks that extend out of the curve or stroke are called tubes. In Paint Effects, strokes are either simple strokes or strokes with tubes. Because the stroke has a curve associated with it, you can move, scale, or rotate the stroke like other objects in the scene. You can edit the curve to modify the shape of the stroke path. 2 Dolly and tumble the scene to better view these strokes with tubes in 3D. 3 Select the Move Tool from the Toolbox. A move manipulator icon appears at the X, Y, Z origin.
To modify the attributes of an existing paint stroke 1 To view the Attribute Editor, click the Show/Hide icon on the Status Line. The Attribute Editor displays. 2 In the scene view, select the paint stroke associated with the daisies. You can select a stroke by one of the following methods: ■ Select the curve associated with the stroke path. ■ Select the tubes associated with the stroke path. The Attribute Editor updates to display the nodes associated with the selected daisy stroke.
The stroke is rotated 90 degrees about the Y axis. 5 Click the strokeShapeDaisyLarge1 tab to see its attributes. This tab is called the stroke attribute node because the attributes establish the paint stroke’s properties when the stroke is first created. 6 Expand the End Bounds section by clicking the arrow to see the Min and Max Clip attributes. Min Clip specifies the start of the stroke along the path. Max Clip specifies the end of the stroke along the path.
8 Drag the Max Clip slider back to its original value of 1.0. 9 Click the daisyLarge1 attribute tab to see its attributes. This is the node that contains attributes related to the paint brush associated with the stroke. 10 Set the Global Scale attribute to 6.0. The daisies scale larger along the stroke’s path. 11 In the daisyLarge1 node, expand the Tubes attributes, then Behavior and Forces.
12 Drag the Gravity slider to the right so that the value of gravity increases to a value of 1.0. The daisies lay on the ground plane, as if wilting, with the increased gravity. Drag the Gravity slider back to its original position approximately so that the stalks appear upright. The last tab in the Attribute Editor is the time node. The time node is used for animation and dynamics. You do not use this node in this lesson.
performance but you don’t see how the paint actually appears. To view the paint strokes in a rendered mode you can either: ■ Render the scene view using the software renderer. ■ Switch to painting in the scene painting view using the Paint Effects panel. To render the paint strokes in the scene view 1 Dolly or tumble the scene so the view of the daisies appears roughly similar to the image below. 2 From the Status Line, click the Render Current Frame button.
The daisies may initially appear a bit dark in the image. The Maya renderer creates a temporary light with a default brightness level in order to render the image when no lights are present in the scene. This ensures that you don’t produce an image that is totally black; however it may not produce the correct illumination for your scene. If you want to obtain more control over the illumination of the daisies, you can create a light for the scene and adjust its brightness.
6 Close the Render View window. Sometimes you may want to view your painted strokes as you paint. To do this, you can paint in the Paint Effects panel view and use the scene painting view mode. To display rendered paint strokes as you paint 1 Press 8 to switch to the Paint Effects panel. NOTE If the 2D Paint Canvas appears instead (i.e.: panel appears white), select Paint > Paint Scene, from the panel menu. The Paint Effects panel menu and toolbar displays as well as the scene painting view.
The scene painting view is a snapshot of the modeling view. In this view you can both paint and view your strokes in a rendered fashion to see what they will really look like as you work. You can dolly, track, and tumble in the scene painting view. You can select objects by pressing the Ctrl key and clicking on them. If you want to move, or otherwise manipulate 3D objects in the scene view, you must exit the Paint Effects panel by pressing the 8 key again.
Now you must manually refresh the Paint Effects rendered view using the Redraw Paint Effects view button in order to see the paint strokes rendered. 5 Dolly the view to obtain a closer view of the daisies. 6 Manually refresh the rendering of the daisies by clicking the Redraw Paint Effects view button. 7 Exit the scene painting view mode by pressing the 8 key. Paint Effects on 3D objects With Paint Effects, you can paint 3D strokes directly on 3D objects in a Maya scene.
In this section, you create a surface for an underwater terrain and sculpt it to the desired form using the Sculpt Geometry tool. You use the underwater preset Paint Effects brushes found in the Visor to begin the underwater scene. Creating a surface to paint on In Paint Effects, NURBS surfaces are the only surface type you can paint on. You will create a NURBS plane, and sculpt it to make its surface appear like an underwater terrain.
This surface will become the seabed terrain for your scene. To sculpt a terrain using the Sculpt Geometry Tool 1 Select the plane surface. 2 On the Status line, select Surfaces from the drop-down menu. The Main Menu changes to display Surfaces menu set. 3 From the Main menu, select Edit NURBS > Sculpt Geometry Tool. The cursor display changes to the brush cursor for the Sculpt Geometry tool.
6 Drag the cursor along the back right edge of the plane to pull it upwards as shown. 7 Drag the cursor along the back left edge of the plane to pull it upwards. 8 Dolly and track the view as required so you can easily view the areas you need to sculpt. 9 Sculpt along the front and middle of the plane to make some bumpy areas. 10 Repeat steps 7 through 10 until you have your 3D terrain looking roughly as shown in the image below.
11 When you complete your terrain, return to the Rendering Menu set by selecting Rendering from the drop-down menu on the Status Line. 12 Hide the Sculpt Geometry Tool settings window before proceeding. To select preset brushes from the Visor 1 From the main menu, select Paint Effects > Get Brush. The Visor panel appears. 2 In the Visor, click the Paint Effects tab to display the various brush folders. 3 Scroll down the brush folders list to the underwater folder, and click it to view its contents.
If you make an object paintable and then try to paint on one that is not paintable, no stroke occurs. If you don’t make any objects in your scene paintable, your strokes are placed on the ground plane. To paint on a 3D object 1 With the terrain surface selected, select Paint Effects > Make Paintable. 2 From the Visor, select the brush named kelp.mel. 3 Paint a short stroke onto your 3D terrain surface.
Using turbulence with brush stroke tubes In the ocean, kelp would react to the turbulence created by ocean currents. The tube attributes associated with many preset brushes have turbulence attributes turned on for interesting visual effects. Turbulence attributes can be increased from their default settings to make the kelp sway back and forth, providing additional realism when used in an animation. To increase the turbulence on the kelp brush tube 1 In the scene view, select the kelp stroke.
You can adjust the turbulence settings while viewing the playback. If the frame range is too short, you can modify it to suit your needs. Using additional preset brushes 1 From the Visor, select the brush named fanCoral.mel. 2 Paint a few fan coral strokes in your scene near the back edges of the plane. TIP If you paint a stroke in your scene and want to delete it you can do so by one of the following methods: ■ Press Ctrl + z to immediately undo the stroke.
5 From the Status Line, click the Render Current Frame button. 6 The renderer executes, renders the image, and then displays it in the Render View window. You can create a seabed texture for the plane primitive, a few rocks, and some animated fish swimming to complete your scene. You can spend additional time to further refine this scene, but this example gives you an idea of how a scene with various 3D props can be quickly established using Paint Effects and the various preset brushes found in the Visor.
Mesh brushes Mesh brushes are a brush type that provide special features not available with other Paint Effect brush types. Mesh brushes render using polygonal triangles rather than brush stamps. As a result, mesh strokes can be more accurately texture-mapped for realistic results. They also appear more realistic compared to other brush types whether they are viewed close-up or from a distance. The mesh brush stroke can also be converted to a polygonal surface in the Maya scene.
3 From the Shelf, select the Paint Effects tab to display the Paint Effects preset brushes. 4 From the Paint Effects shelf, select the Teapot Brush. In the scene view, the cursor changes to a sphere icon indicating it is set to paint a stroke. The Teapot Brush is a mesh brush type. 5 In the scene view, drag your mouse or stylus along the ground plane to create one short stroke. 6 Dolly and tumble the view to see the wireframe version of the stroke.
To render the paint effects stroke 1 From the Status Line, click the Render Current Frame button. The renderer executes, renders the paint stroke, and then displays the image in a Render View window. 2 Close the Render View window. Mesh brush types are useful for representing hard surfaces compared to other brush types (the teapot is one example). Converting mesh strokes to polygons Mesh strokes can be converted to polygons.
2 Select the teapot stroke, if it is not already selected. 3 Select Modify > Convert > Paint Effects to Polygons > . 4 In the Convert Paint Effects to Polygons Options window, ensure that the Hide Strokes option is set to On. Setting the Hide Strokes option to On ensures that after the conversion, only the converted polygon mesh will be displayed. 5 In the Convert Paint Effects to Polygons Options window, click Convert. The mesh brush stroke is converted to a polygonal surface.
Modifying a converted polygonal mesh By default the original brush stroke is linked to the new polygonal surface via construction history. If you modify the original brush stroke attributes, the polygonal surface will update so long as the construction history link exists. This construction history link allows you to easily modify the polygonal mesh surfaces in a variety of ways. You modify the brush stroke attributes using the attribute editor.
4 In the Attribute Editor, expand the Mesh attributes section to display its attributes. 5 In the Mesh attributes, drag the Tubes Sections slider to the left to a value of 3. The body, spout, and handle of the teapot update to display as 3 sided surfaces.
Tube Sections defines the number of sides around the width of the tubes in a mesh stroke. Changing the Tubes Sections gives a range of results depending on the brush type you choose. 6 Set the Tubes Sections to a value of 18. 7 In the Attribute Editor, close the Mesh attributes, and then expand the Tubes attributes, then the Creation attributes. The Creation attributes control the main body of the teapot; the “trunk” or “stalk” of your paint effect mesh type. 8 Scroll down to the Width Scale attributes.
The Width Scale graph allows you to control the width of a tube by interpolating the shape between the index points. (If you look closely at the graph, you’ll see the profile of the teapot laying on its side.) 10 Drag the index marker back to its original position. 11 Close the Creation attribute section in the Attribute Editor, and open the Growth attributes, followed by the Leaves attributes.
If you want to adjust the attributes of the teapot handle, you can edit the Flower attributes. Using this converted poly mesh is one example of how the attributes of the paint stroke can be modified to affect the shape of another object through construction history. If you delete the paint stroke, the construction history between the stroke and the polygonal teapot will be removed. If you then want to make further changes to the teapot, you must use the Edit Polygon tools.
■ Paint directly in 3D space onto the ground plane or onto 3D objects. ■ Select and move strokes in the scene. ■ Edit brush and stroke attributes using the Attribute Editor. ■ Render paint strokes. ■ Use the Paint Effects Panel to paint fully-rendered paint strokes. ■ Create a terrain to paint on using the Sculpt Geometry tool. ■ Understand the structure and archetype for strokes with tubes. ■ Use mesh brush types to paint hard-surface objects.
■ Paint using a Thin Line brush type which allows you to render large numbers of fine tubes much more quickly than the Paint Brush type. This brush type is useful for painting hair. Lesson 3: Painting textures on surfaces Introduction The 3D Paint Tool allows you to paint textures directly onto a model’s surface. In this lesson, you paint colors, patterns, and textures on a dinosaur model. In this lesson you learn how to: ■ Prepare a surface model for painting.
The scene contains a model named Dino. Although Dino is a polygonal model, the 3D Paint Tool works on all surface types: polygonal, NURBS, and subdivision surfaces. To prepare for this lesson, we assigned a Blinn material named DinoSkin to the model. In Maya, you can paint a surface only if it has a material assigned to it. We also gave the Blinn material a green color. A color is optional, but it provides a base color for the texture you will paint.
The 3D Paint Tool requires that the material assigned to your model has a file texture applied to it. Because there is no file texture yet assigned, the warning appears. When you move the cursor over Dino, you see a circle-X icon that indicates you cannot paint on the model. 3 To make sure you have the default settings for the 3D Paint Tool, click Reset Tool at the top of the 3D Paint Tool settings panel.
Painting with an Artisan brush In the following steps, you paint various colors on the texture you just assigned. You also change the size of the brush strokes. There are two types of brushes you can use. The default is the Artisan brush, which you’ll use in the next steps. (Artisan refers to a group of painting tools in Maya that share common tool settings.) The other brush is based on the Paint Effects brushes; you’ll use it later in the lesson.
6 Experiment with different colors and brush sizes on Dino. To undo a brush stroke, choose Edit > Undo, Redo, Repeat. The number of strokes you can undo is specified by the Queue Size in the Undo category of the Preferences window (Window > Settings/Preferences > Preferences). 7 To remove paint, turn on Erase in the Paint Operations section and stroke the desired region.
As you paint, the strokes are reflected along the axis and appear on the other side of Dino. Tumble to see the reflected stroke on Dino’s other side. Using Flood All to apply a single color You can apply a single color to the entire texture without painting individual strokes. To use Flood All to apply a single color 1 In the Flood settings of the 3D Paint Tool settings, click the Color box and select a pale green color from the Color Chooser.
3 In the Brush settings, click the following icon and paint a stroke: By changing to the square brush shape, your brush stroke has a straight edge. Along with the shapes available from the icons, you can choose from many other unusual brush shapes that are based on image files. You’ll do this in the next step. Before you do the next step, undo the brush stroke you just made so it doesn’t distract from the next paint strokes. 4 In the 3D Paint Tool Brush settings, click the Browse button.
The brush shape pattern overlaps itself as you paint, resulting in a striped pattern. Undo the stroke. 8 To avoid the overlapping pattern of the prior step, increase the Stamp Spacing (in the Stroke section) to 50. Paint on Dino with a continuous stroke and you’ll see the brush pattern without it overlapping. The Stamp Spacing setting defines how paint is applied when you stroke the surface. If you set Stamp Spacing to 1, the edges of the brush shape pattern just touch each other.
The Visor window opens. The Visor organizes the hundreds of Paint Effects brushes into category folders. 2 Scroll to the watercolor folder and click it. To the right, swatch pictures of the Paint Effects brushes appear for this category. 3 Select the spatterLight.mel brush. (To see the names of the swatches, drag the pointer over them.) Leave the Visor window open, but move it so you can see Dino again.
6 Open the Shading section in the Paint Effects Brush Settings window. For the Incandescence1 setting, move the slider to the right and stop midway. 7 Close the Paint Effects Brush Settings window and paint on Dino. Now the paint has an incandescent glow. Smearing and blurring In the next steps you’ll smear and blur the paint on Dino. Smearing with a Paint Effects brush blends adjacent colors together along the stroke path. Blurring softens the edges of adjacent colors by averaging their color values.
4 In the Paint Operations section of the 3D Paint Tool settings, select Paint Effects Blur. This selects the default Paint Effects Blur brush. 5 Paint across the side of Dino to see the effect of Blur. Painting a bump map texture Next, you’ll paint a bump pattern on Dino. In Maya, a bump texture creates the illusion of surface relief. It does this by perturbing the surface normals to make the surface appear bumpy. This is useful for making Dino’s skin appear more “reptile-like”.
Earlier in the lesson, your painting affected only the Color attribute. To paint bumps, it’s necessary to select a BumpMap as the new attribute you want to paint, and then assign a new texture for the bumps you’ll create. 4 In the Assign/Edit Textures window, set both Size X and Size Y to 512 and then click Assign/Edit Textures. Maya creates a file texture and applies it to the Bump Map attribute of the DinoSkin material. In the scene view, Dino’s color changes to white.
This region will update when you paint. For the IPR renderer to render bumps as you paint, you must update the bump map texture after each stroke. You can set this to occur automatically. 10 In the File Textures section of the 3D Paint Tool settings, turn on Update on Stroke. For a grooved bump effect, you need to change the brush shape. 11 In the Brush section of the 3D Paint Tool settings, click the Browse button. 12 Select the hatch.jpg brush and click Open. 13 Paint on Dino’s side.
15 Select Display > UI Elements > Channel Box/Layer Editor. Beyond the lesson In this lesson you were introduced to a few basic techniques related to the 3D Paint Tool. You learned how to: ■ Paint textures directly onto surfaces using the 3D Paint Tool. ■ Paint symmetrically onto surfaces. ■ Paint grey scale attributes to create bump texture effects. There are several other capabilities in the Paint Operations section, such as the Clone option for Artisan brushes.
If you already have experience with editing UVs, remember these two requirements for 3D painting: ■ UVs must not overlap. ■ UVs must fit with the 0 to 1 texture coordinates. This illustration shows the UV Texture Editor with the UVs for the Dino model used in this lesson. These UVs meet the above two requirements. Notice that the UVs form several meshes; they do not need to be one solid mesh. Painting in Screen Projection mode When you paint on a model, the brush follows the contours of the surface.
Beyond the lesson | 623
624
Expressions 12 Introduction Expressions are program-like instructions you create to control keyable attributes over time. Expressions can be comprised of mathematical equations, conditional statements, or MEL™ commands. Expressions offer an alternative to difficult keyframing tasks similar to Set Driven Key. With Set Driven Key, attribute relationships can be set up and are defined using animation curves.
This chapter contains the following lessons: ■ Lesson 1 Creating a simple expression: Introduction on page 627 ■ Lesson 2 Conditional expressions: Introduction on page 634 ■ Lesson 3 Controlling particle attributes: Introduction on page 643 Preparing for the lessons To ensure the lessons work as described, do these steps before beginning: 1 Select File > New Scene to create a new scene.
Lesson 1: Creating a simple expression Introduction This lesson introduces you to some basic concepts regarding the creation and editing of expressions. You learn how to: ■ Use the expression editor to create and edit expressions. ■ Control both single and multiple attributes of objects in your scene.
Note that the Attributes list displays Ball’s keyable, unlocked attributes—the attributes you’ll most likely want to animate with an expression. Use the scroll bar to see the entire list. 5 Enter this expression in the expression text area: Type all characters exactly as shown above. Entries are case sensitive. The semicolon (;) signifies the end of the expression statement. End each statement in an expression with a semicolon.
Frame Time (seconds) 3 0.125 24 1.0 240 10.0 You can find the time elapsed in the animation at any frame by calculating this formula with a desktop calculator: For example, if the frame rate is 24 frames/second and the animation is at frame 1, the elapsed time is 1 divided by 24, or 0.0417. At frame 6, the elapsed time is 6 divided by 24, which equals 0.25. Note that if your frame rate was 30 frames/second the calculated values would be different. 7 Go to the start time and play the animation.
To see the value of Ball’s scaleY attribute at any particular frame, select Ball, display the Channel Box, and stop the animation at the desired frame. The Channel Box updates its values after you stop the animation. The scaling is smooth because the geometry stretches in synch with the small time increments of the animation playback. 8 Close the Expression Editor window.
Clicking the Edit button does the same action as clicking the Create button. The Create button exists only for new expressions. The Edit button replaces the Create button when you display an existing expression. 5 Play the animation to see the results of the new expression. The sphere scales at a slower rate than before. 6 Stop the animation and go to the start time. 7 At this point and in subsequent steps, save the scene if you think you’ll want to examine it at a later date.
Controlling attributes in two objects You can add an object to the scene and use the expression to control any of its attributes also. For example, suppose you added a default NURBS or polygonal cylinder named Drum to the scene. You could control the attributes of Ball and Drum with the same expression as in this example: Ball.scaleY = time/2 + 1; Drum.scaleX = time + 1; Drum.scaleY = time + 1; You can link attributes in different objects—so a change in one attribute alters the behavior of the other.
another attribute, such as setting the ball’s scale Y and Z attributes to equal the scale X value. ■ Control multiple attributes with a single expression. Your expressions can control multiple attributes of the same object or of multiple objects. Alternatively, you can write a single expression for each attribute or object. For more information on the various mathematical operators that are possible with expressions, refer to the Maya Help.
Lesson 2: Conditional expressions Introduction Conditional statements set one attribute or variable for an expression based on the condition of another attribute or variable. This means that when a particular defined condition exists for one attribute then another attribute is changed based on how the expression defines it to do so. In this lesson you learn how to: ■ Use conditional statements to control an expression. ■ Refine the conditional statements using if and else statements.
The expression checks whether the value of time is less than two seconds. If so, it does the assignment Balloon.scaleY = time. If time is not less than two seconds, the assignment doesn’t occur. NOTE When you compare the value of time to a number in an expression, Maya interprets time as seconds rather than milliseconds, minutes, or any other unit of time. In the example, Maya interprets 2 as two seconds. Notice how the assignment Balloon.
When time equals 2 or more, the if condition is no longer true. The statement that follows it, Balloon.scaleY = time, no longer executes. The value of the scaleY attribute stays at the last value it had before time became 2, specifically, 1.9583. Recall that this example uses a frame rate of 24 frames per second. The time and Balloon.scaleY have these values at various frames: Frame Time (seconds) Balloon.scaleY (time) 0 0 0 1 0.0417 0.0417 2 0.0833 0.0833 3 0.125 0.125 24 1.0 1.0 47 1.
Other conditional statement options You can make Balloon rise after it inflates by adding another if statement to the expression. To add an if statement to the expression 1 Change the expression to this: if (time < 2) Balloon.scaleY = time; if (time >= 2) Balloon.translateY = time; 2 Click Edit to compile the expression. 3 Play the animation. Balloon inflates for two seconds. After two seconds, Balloon stops inflating and its position skips from a Y-axis position of 0 to 2.
5 To make Balloon return to the origin, change the expression to this: if (time < 2) Balloon.translateY = 0; if (time < 2) Balloon.scaleY = time; if (time >= 2) Balloon.translateY = time; The new first statement sets Balloon.translateY to 0 whenever time is less than 2. Note that you can put the three statements in any order in this example. When Maya plays each frame, it executes each statement in the expression in the order listed.
Fixing a problem in an expression As mentioned before, Balloon skips from Y-axis position 0 to 2 after two seconds of animation play. You can eliminate the skipping and make Balloon rise smoothly from the origin. To fix the skipping in the animation 1 Stop the animation and go to the start time. 2 Change the expression as follows. (Changes are displayed in bold print.) if (time < 2) Balloon.translateY = 0; if (time < 2) Balloon.scaleY = time; if (time >= 2) Balloon.translateY = time - 2; 3 Click Edit.
Balloon.translateY = 0; if (time < 2) Balloon.scaleY = time; else Balloon.translateY = time - 2; 2 Click Edit. 3 Play the animation. The animation plays back exactly as before. This additional variation on the if conditional statement includes the else statement. It is used as an option when the if statement condition is not true. The else keyword sets Balloon.translateY to time - 2 when (time < 2) is false.
if (time < 2) { Balloon.translateY = 0; Balloon.scaleY = time; } else Balloon.translateY = time - 2; We removed the second if statement: if (time < 2) In its place, we enclosed the remaining statements with braces { and }. Maya evaluates both the statements between the braces if the condition (time < 2) is true. Setting Ball.translateY to 0 here instead of in a separate if statement makes the expression easier to read and comprehend.
3 Play the animation. The scaleY attribute increases at 60% of the value of time, so Balloon expands slower during playback. (The number 0.6 equals 60%.) By the time Balloon starts to rise, it has expanded to the size of a typical balloon. To know whether to multiply time by 0.6 or some other number, you need to experiment. For example, you might multiply by various percentages such as 0.2, 0.5, 0.75, and finally 0.6. The 0.6 creates a life-like balloon shape at two seconds.
As time increases, the value of Balloon’s scale attributes increase. Because the expression sets scaleX and scaleZ to 50% of the value of time, these dimensions scale slower than scaleY, which is set to 60% of the value of time. Balloon scales faster in height than in width or depth. This is true for many real balloons. 4 Stop the animation and go to the start time. 5 Save the scene if you plan to examine it later.
you can write an expression to control all particles in an object the same way, or you can control each particle differently.
6 In the Attribute Editor, select the BubblesShape tab, and then open the Render Attributes section and set the following: ■ Particle Render Type: Spheres ■ Add Attributes For: Click the Current Render Type button. ■ Radius: 0.5 7 In the Add Dynamic Attributes section of the Attribute Editor, click the Color button. A window appears that prompts you to choose whether to add the attribute per object, per particle, or connected to a shader.
transform node of the particle object. If a particle object’s transform node is selected, move the mouse pointer to the scene view and press the down arrow key to select the particle shape node. 2 Enter this expression and then click the Create button: BubblesShape.rgbPP = <<1,0,0>>; When you click the Create button in the Expression Editor, Maya checks the syntax of the expression. Assuming you made no typing errors, the expression executes once for each of the 100 particles.
To create a runtime expression 1 In the Per Particle (Array) Attributes section of the Attribute Editor, right-click the rgbPP box and select Runtime Before Dynamics Expression from the pop-up menu. 2 Enter this runtime expression: BubblesShape.rgbPP = sphrand(1); 3 Click the Create button to compile the expression. 4 Play the animation. The particles flicker in random colors as the animation plays back. The runtime expression controls the rgbPP attribute during playback.
NOTE You can use only one creation and one runtime expression per particle object (shape node) in your scene. To control multiple attributes of a single particle object, you must do so within one creation expression and one runtime expression. You can’t create a separate expression for each attribute as you can for other types of objects. You therefore don’t need to select an attribute from the Expression Editor’s Attributes list.
Note that you can change the beginning red color to random colors by changing the creation expression to this: BubblesShape.rgbPP = sphrand(1); This is the same expression as the runtime expression. 3 Save the scene if you plan to examine it later. This concludes the lesson. Beyond the lesson In this lesson you learned how to: ■ Control particles using creation and runtime expressions. ■ Apply a random function to your expression.
understanding of expression execution and syntax is essential. You also need to become familiar with the built-in mathematical functions such as the sphrand function introduced in this lesson. For further information and related techniques, refer to the Maya Help.
Scripting in Maya 13 Introduction Scripting languages in Maya allow you to: ■ Automate repetitive or frequently performed tasks. You can write scripts to execute operations that would normally be selected from the user interface or performed using tools and user manipulation. ■ Change Maya’s user interface. You can create windows and controls that affect objects in the scene. ■ Establish development standards. You can enforce naming conventions, workflows and model scales.
Some basic concepts The following section introduces some basic concepts that help you understand what’s going on when you use scripting in Maya. The command architecture Maya has a command-based architecture for handling all of its operations. The commands for all of Maya’s functionality are accessed through scripting language commands tied to the Maya user interface—menus, tools, dialog boxes; in fact, just about anything you interact with in Maya.
Entering commands in Maya There are several ways to explicitly enter scripting commands in Maya. ■ To enter single line MEL and Python commands, use the Command Line. To show the Command Line if it is hidden, select Display > UI Elements. The Command Line is located near the bottom edge of the Maya interface. ■ To enter multi-line MEL and Python commands, use the Script Editor. The Script Editor displays a history of executed commands, as well as the results and outputs of commands.
NOTE MEL also has an alternate syntax, which implements commands and flags in a method similar to the C programming language. For more information, see MEL for programmers in the MEL and Expressions guide. Getting help on MEL You can get help with MEL in three ways: ■ To access help on a particular MEL command, open the MEL Command Reference by selecting Help > MEL Command Reference. ■ Help can also be accessed from within the Script Editor by using the Maya Command help.
All Python commands are case-sensitive; maya.cmds.SPHERE is not the same as maya.cmds.sphere (and returns an error message). Getting help on Python You can get help with Python in several different ways: ■ To access help on a particular Maya (Python) command, open the Python Command Reference by selecting Help > Python Command Reference. ■ You can also access help on Maya Python commands from within the Script Editor by using the Maya Command help(). For example: typing maya.cmds.
3 Make sure the Construction History icon (below the menu bar) is on. (If it is turned off, it has a large X across it.) 4 Ensure that the interactive creation option for primitives is turned off by selecting Create > Polygon Primitives > Interactive Creation. The option is off when a check mark does not display beside the item’s name in the menu. 5 Ensure that the interactive creation option for surfaces is turned off by selecting Create > NURBS Primitives > Interactive Creation.
■ Enter MEL commands in the Script Editor ■ Create geometry with MEL commands ■ Modify attributes of objects with MEL commands ■ Interpret Script Editor history Entering MEL commands You can enter MEL commands in the Command Line or the Script Editor. The Command Line can only accept single line MEL commands, while the Script Editor provides a method to input multiple MEL commands and view the results. To use the Command Line to input MEL commands 1 Select Display > UI Elements.
In the Script Editor, the Enter (Windows and Linux) or Return (Mac OS X) key above the Shift key does not execute a command. It starts a new line so you can type several commands before executing them. Observing script history The Script Editor displays a running history of executed commands and the results of commands that Maya executes. You can copy most commands from the history section of the Script Editor and paste them in the input section to execute them.
➤ In the Script Editor window, ensure that there is not a check mark beside History > Echo All Commands. To observe script history 1 In the Script Editor, click the Clear History button. You can more easily isolate the command history created by the commands you perform when there is no other history in the Script Editor. 2 From the Shelf, select the Surfaces tab in order to view the tools located on that shelf. 3 Click the NURBS Sphere button on the Surfaces Shelf.
TIP For more details on these flags, see sphere in the MEL Command Reference. The MEL Command Reference gives a complete listing of the functionality of all MEL commands and flags. NOTE You can copy commands from the Script Editor history section and paste them in the input section to execute them. ➤ Delete the NURBS sphere by pressing the delete key on your keyboard. To type a MEL command in the Script Editor 1 Select a MEL tab in the Script Editor.
The command is removed from the input section of the Script Editor after execution. The command and the result of the command is output to the history section of the Script Editor: polyCube; // Result: pCube1 polyCube1 // NOTE In future lessons, when a series of MEL or Python commands creates output, only the output created by the commands will be referred to as output to the Script Editor. Comments in MEL begin with // and anything which follows these characters on a line is ignored by MEL.
The polygonal cube is moved to the XYZ co-ordinates 3,2,1. The move command has set the translate attributes to the specified arguments of the command. These arguments are called command arguments as they are not used with flags. When a command is typed into the Script Editor, it acts on the current selection, unless an object name is provided as an argument to the command.
The radius flag allows you to specify a value for the radius of the sphere. The value 2 is associated with the radius flag, and is not a command argument. This is equivalent to specifying values within the Polygon Sphere Options dialog in the Maya interface. NOTE Flags have short and long names. Commands execute the same way whether or not you use long or short flag names.
This is equivalent to renaming an object with the Attribute Editor or the Channel Box in the Maya interface. Editing Objects Some MEL commands can take an edit flag that allows you to make changes to the attributes of an object. The edit flag is used in conjunction with other flags specifying which attributes to change.
Commands can operate on objects other than what is currently selected by specifying an object name as an argument. The name must be the last argument in the command. 4 Select the cube and the sphere simultaneously by holding down shift and clicking the sphere. 5 Delete the objects by typing the following in the Script Editor delete; NOTE A list of all flags available for a specific command can be displayed in the Script Editor by typing help command;.
Before proceeding with the next lesson you may want to review the material presented in this lesson so you are familiar with the concepts and skills. Some suggested tasks you can try on your own include: ■ Practice using creation commands through the user interface and observing the resulting Script Editor history. ■ Look through the MEL Command Reference to see more common commands. ■ Practice copying and pasting commands from the Script Editor history section to the Script Editor input section.
Three-point lighting is used extensively in film, photography and computer graphics. Setting up the scene Here, you create some primitive objects to display lighting and shading . 1 Select File > New Scene to create a new scene. 2 Select Window > General Editors > Script Editor to open the Script Editor. 3 Create a ground plane by typing the following: polyPlane -height 40 -width 40; A plane appears at the origin. The height and width flags specify the dimensions of the plane.
8 Save the rendered image by clicking the Keep image button . This lets you compare your rendered image with future rendered images. A scroll bar at the bottom of the Render View lets you scroll through your saved rendered images. In the next steps, you type commands to create three-point lighting in the scene and record them as script history for later use. Recording the script history In order to make a shelf button, you need to create Script Editor history to copy to the shelf.
Certain commands require that you to refer to the light by name. 3 Rename the selected light to “main_light” by typing the following: rename main_light; 4 Enable the main light to cast shadows by typing the following: setAttr "main_lightShape.useDepthMapShadows" 1; The setAttr command allows you to set attributes of a node. In the above command, you are enabling depth map shadows on the main light.
To create the fill lighting 1 Create a point light with an intensity of 0.5 by typing the following: pointLight -intensity 0.
When creating three-point lighting in a scene with multiple objects, typically there is a main light that provides the main lighting for the scene, and each object in the scene has a linked fill and rim light. Your three-point lighting script only works for objects of medium scale located at the origin, but once the lights are created, you can tweak them to better suit your scene. Saving the history as a button You can save Script Editor history as a Shelf button.
4 Click the MEL button on the pop-up window. A Shelf button is created that executes the scripting commands you dragged to the shelf setting up three-point lighting for a scene. To test the Shelf button 1 Open the scene named Mel_cone.mb. This file can be found in the GettingStarted directory that you set as your Maya project: GettingStarted/MEL 2 Render the scene in the perspective view by selecting the render scene button on the Status Line.
To delete the Shelf button ➤ Middle-drag the Shelf button you want deleted to the trash can icon on the far right of the Shelf. NOTE The pointer icon changes to a button. icon when you are dragging a Shelf Beyond the Lesson In this lesson, you learned how to copy history from the Script Editor history section to create Shelf buttons so that you can quickly execute a series of commands. You can: ■ Save multiple MEL script commands as a Shelf button.
■ You can also create custom icons for your Shelf buttons in your favorite image editing program. Icons must be 32X32 pixels and in bitmap format. Lesson 3: Using Variables in MEL Introduction In this lesson, you learn how to store data in MEL variables. Variables are a method of storing data in programming, including scripting languages. In this lesson you use the saved value of a variable to create a pyramid of barrels using MEL scripting commands.
This file can be found in the GettingStarted\MEL directory that you set as your Maya project. 2 Open the Script Editor by selecting Window > General Editors > Script Editor. 3 Select the barrel with the select tool. 4 In the Script Editor, type the following: Type exactly as below: rotate -r 0 0 90; The barrel is rotated 90 degrees about the Z axis. Storing scene information You will store the value of the measurement annotation as a variable.
Name and type cannot change after creation. The value of a variable can change, but the value must be of the earlier defined type. NOTE Variables in MEL should always have their type explicitly defined. If not explicitly stated, the scripting language attempts to imply a data type for the variable from the context of the first appearance of the variable.
To declare an int variable ➤ Type the following in the Script Editor int $testInt = 5; print ($testInt/2); The following is output to the Script Editor: 2 The int data type is used to store integer values. Integers are positive and negative whole numbers. In programming, when an integer is divided by another integer, the result is an integer, which is why the output here is not 2.5 (2.5 is not an integer). The print command’s argument is enclosed in brackets.
move -r 0 0 $diameter_barrel; A duplicate of the original barrel is created and aligned to the first barrel. 4 Make another copy of the barrel by typing the following: duplicate; move -r 0 0 $diameter_barrel; The current selection switches to the newly created geometry. 5 Duplicate the currently selected barrel and align the duplicate with the previously created barrel. duplicate; move -r 0 0 $diameter_barrel; When duplicating objects, the selection always switches to the duplicate.
Using basic trigonometry, you can calculate the unknown height offset. MEL has a library of built-in functions that include trigonometry functions, to handle these calculations. NOTE Trigonometry functions are ratios that relate two sides of a right angled triangle dependant on one of the angles of the triangle. Trigonometry functions are often used for animation, as trigonometric functions are periodic. Periodic functions cycle their output values after a certain period.
float $Y_offset; 2 Calculate the value of the Y-offset using the sine ratio. You must convert the value of the angle to degrees with the degree to radian conversion function. $Y_offset = $diameter_barrel * (sin(deg_to_rad(60))); The assignment operator evaluates the right hand side of the expression and assigns it to the left hand side. The degree to radian conversion function is the first to be evaluated, as it is within the most interior set of brackets.
Creating dynamics with MEL commands Maya lets you easily add dynamic properties to the objects in your scenes. All attributes that can be modified by selecting menu items, can be accessed by setting the arguments of a Maya command. In this section you create a dynamic simulation using MEL so that the stack of barrels reacts to gravity and moves in a realistic manner. Apply a rigidBody node to all of the barrels, add a gravity field and a passive rigid body plane for the barrels to collide with.
2 Move the stack of barrels upwards along Y (by half the height of a barrel) so they are not intersecting the ground plane. move -r 0 (0.5*$diameter_barrel) 0; 3 Add a gravity field to the selected geometry by entering the following in the Script Editor. performDynamics 1 Gravity 0; When a gravity field is added to the geometry, rigid body nodes are automatically added to the geometry.
Beyond the lesson In this lesson, you were introduced to how to use variables in MEL with Maya. You can: ■ Declare, set and use variables. ■ Perform mathematical operations to modify the value of a variable. ■ Implement dynamics using MEL commands. Before proceeding with the next lesson you may want to review the material presented in this lesson so you are familiar with the concepts and skills associated with them.
■ Use conditional statements to check the existence of a window ■ Use a built-in Maya procedure ■ Link a procedure to a user interface Creating a window The first step in creating custom user interfaces is to create a window. This window contains the elements of the user interface such as text, buttons and other controls. To create a window 1 Type the following commands into a MEL tab of the Script Editor. window -resizeToFitChildren 1; showWindow; A window appears.
use it.) You cannot reference or modify windows or controls that you don’t know the name of. To refer to a user interface element by name 1 Create a window with text and a button that closes it by typing the following in a MEL tab of the Script Editor: window -resizeToFitChildren 1 testwindow; columnLayout; text -label "This is a test window you can close by\ clicking the button below."; button -label "Close" -command "deleteUI testwindow"; showWindow; 2 Press the Close button in the window.
Strings can’t be split up over multiple lines without the use of a special character. To split a string over multiple lines, use the back slash (\) character. For example: print "With the \\ character, you can \ split a string over \ multiple lines."; To have a backslash appear in a string, you must use a double backslash. The backslash character is an escape character. Escape characters tell the script interpreter that the character that follows is literal.
// Error: line 1: Object's name is not unique: testwindow // All objects in Maya and user interface elements must have unique names. To query a window’s existence 1 Type the following command in the Script Editor input section, to delete the hidden window: deleteUI testwindow; 2 Check if the window exists by typing the following command: window -exists testwindow; The following result is output to the Script Editor.
Two concepts are being introduced here: ■ The if statement allows a certain part of code to execute depending on a condition. The section of code within the curly braces only executes if the statement inside the parentheses evaluates to true. ■ The paired back-ticks within the parentheses (` `) indicate that the commands within them are evaluated first.
We’re using backticks for evaluation again here, though in this case, we’re creating three variables ($button_one, $button_two, and $button_close) that hold the results of calling the button command each time. 2 Press one of the “Click Me!” buttons in the window to test the script. Clicking one of the “Click Me!” buttons deletes the other button by calling the deleteUI command with the variable that stores the name of the button control as an argument (button_one or button_two).
In this section, you use a procedure that is included with Maya (makeroll, which simulates an object rolling on a plane). Later in the lesson, you link this procedure to a user interface to provide an easier way to use the procedure.
You have successfully loaded and used the makeRoll procedure. Now, you’ll link the procedure to a user interface. Loading a script file You can read and edit script files other people have created in the Script Editor. In this section, you open a script that contains a completed user interface for the makeRoll procedure. However, the user interface is only a layout, and does not contain any functionality.
In the next steps, you load a user interface script into both MEL tabs. The MEL tab will contain the original script, and the MEL2 tab will contain the user interface script with your modifications. This way, line numbers can be referenced from the original script to inform you where to make a modification. To open a script file in the Script Editor 1 Select the MEL tab. 2 In the Script Editor, select File > Load Script. 3 Select the MEL script named Mel_UI_Start.mel.
Conditional statement if(`window -exists makeRoll_Window`==1) { dow; } deleteUI makeRoll_Win The conditional statement checks if a window with the specified name exists. If the window exists, it deletes it. Window command window -resizeToFitChildren 1 makeRoll_Window; The window command creates a user interface window to contain the controls. For more information, see Creating a window on page 684.
flags. The name and path of the slider are stored as a variable. See Storing control names on page 688. ■ The editable flag can be used to enable or disable editing of the text field. ■ The minValue and maxValue flags set the minimum and maximum values for the slider. ■ The field flag enables the visibility of an editable value field beside the slider. By default, the field is not visible. ■ The fieldMaxValue and fieldMinValue flags set the minimum and maximum values for the field beside the slider.
NOTE In the script above, you do not explicitly declare your variables. This is because the return type of user interface creation commands is known to be a string, and cannot be any other data type. Later in the lesson, you will allow a data type to be implied, as you do not know what data type the return will be. Linking the user interface Currently the user interface in the window doesn’t do anything: moving the sliders and clicking the check boxes has no effect.
In this next section, we’ll also create a new tempMEL tab so you’ll have a place to test commands as you learn them. To store the names of the currently selected objects as a variable 1 Create a new MEL tab (Command > New Tab in the Script Editor). 2 Rename it tempMEL (Command > Rename Tab in the Script Editor) 3 Type the following in the tempMEL tab: select -allDagObjects; This command selects all scene objects.
The first element of the array, the roll_Cube, is selected. Elements of an array are accessed using square brackets containing the index number of the element you want to extract from the array. The index number of arrays start counting from zero.
■ The offCommand flag triggers when the check box is unchecked. You can use the checkBox command with an edit flag to change the state of a check box in the user interface. To change the values of elements in the user interface 1 In the tempMEL tab, change the state of the make roll window’s check box by executing the following: checkBox -edit -value 0 $box_sim_checkbox; The Box Simulation check box, which was turned on, is now turned off.
Executing the procedure The makeRoll procedure requires arguments to execute. To link it to the window, you must get the values for the arguments from the controls in the user interface, and execute the makeRoll procedure with these arguments. To get the values of the controls, you must use the query flag. The query flag allows commands to return values of attributes in the scene. To query a value in the user interface 1 Change the value of the diameter slider to 10.
Every argument of the user interface is defined by querying the user interface elements. The backslash at the end of a line allows the command flag argument to span multiple lines. Your user interface is now fully functional! A completed version of the user interface script named Mel_UI_Final.mel is available in the GettingStarted project directory (GettingStarted/mel). Saving the script To use your script in other scenes, you must save it.
NOTE When saving a script, you must have the .mel extension appended to the script file name in the Save Script dialogue box. Using the saved script file You can apply the makeRoll procedure to any geometry quickly by selecting the object to apply makeRoll to, and executing the makeRoll_create_UI global procedure. Before using a script in your scene, you must source it. Sourcing executes all the commands within a script file.
5 Set the frame to greater than one to view the effects of the makeRoll procedure. 6 Set the following values in the makeRoll user interface: ■ Ground Plane = 0 ■ Diameter = 1.0 ■ Box Simulation = checked ■ Sphere Simulation = unchecked 7 Click the “Execute” button to setup the makeRoll expressions. 8 Move the pyramid in X and Z to view the results of the makeRoll procedure. Explore different results that occur when you apply the makeRoll procedure with different user interface control values.
You can create fully customized user interfaces with MEL scripting. There are additional user interface elements not covered in this lesson. For a full list of user interface elements, look in the MEL Command Reference. You can open the MEL command reference by selecting Help > MEL Command Reference from the menu bar. User interface commands are in the Windows category of the MEL Command Reference. Lesson 5: Using Python in Maya Introduction Python scripting in Maya is very similar to MEL scripting.
■ Call MEL scripts from Python Entering Python commands Just like MEL, you can enter Python commands in the Command Line or the Script Editor. The Command Line can only accept single line Python commands, while the Script Editor provides a method to input multiple Python commands and view the results. The Script Editor displays a running history of executed commands and the results of commands that Maya executes.
In the Script Editor, the Enter (Windows) or Return (Mac OS X) key above the Shift key does not execute a command. It starts a new line so you can type several commands before executing them. TIP You can import maya.cmds automatically at startup by creating a file called userSetup.py in your Maya scripts directory. The userSetup.py file can contain any Python commands you want to execute at startup. For more information, see Initializing the Maya Environment in and for Python.
To use a Maya command with positional arguments 1 Move the polygonal cube that you created with the following Python command: cmds.move(1,2,3) The polygonal cube moves to the XYZ co-ordinates 1,2,3. The move command accepts XYZ co-ordinates as its commands arguments. 2 Scale the polygonal cube with the following command: cmds.scale(2,2,2) 3 Re-scale the polygonal cube with the following command: cmds.
When a command is not provided with enough command arguments, the command uses the default arguments. The polygonal cube X scale is set to three, but the Y and Z scale values are set to their default argument one. 4 Delete the selected polygonal cube. cmds.delete() Using flags in Python Flags are used with commands to modify their execution. Python implements flags as named arguments. Some flags in MEL do not require values.
2 Create a polygonal sphere with the radius and subdivisions in X and name defined at creation time. cmds.polySphere(radius=1, subdivisionsX=4, name="testSphere") You can use multiple flags to modify the execution of a command by separating the flag-value pairs with a comma. The radius flag sets the radius of the created sphere. The subdivisionsX flag sets the number of subdivisions in X for the sphere. NOTE A list of flags available for a command can be output to the Script editor by typing cmds.
4 Move the polygonal cube relative to its current position by typing the following: cmds.move(-1,0,-2,relative=True) The polygonal cube moves relative to its current position. The relative flag must be placed after the command arguments, as in Python, when passing arguments, named arguments must appear after positional arguments. The command arguments must always be the first arguments of the command. 5 Move the polygonal sphere without selecting it by typing the following: cmds.
To use flags with multiple arguments in Python 1 Create a yellow tinted point light by typing the following: cmds.pointLight(rgb=(1,1,0.5)) The point light command creates a point light at the origin. The rgb flag specifies the color of the light. The rgb flag require three values; red, green and blue. When flags require multiple values, the values must be packed within Python’s tuple or list data types.
8 Select all objects in the scene and delete them by typing the following cmds.select(allDagObjects=True) cmds.delete() Using the Maya command select with the allDagObjects flag selects objects that exist physically in the scene such as geometry, IK chains and measure tools. These appear on an internal Maya representation called the DAG. For more information, see DAG.
The axis flag specifies the initial orientation of the torus. Geometry creation commands return the name of the created object, so you can easily refer to the object by storing the name of the object as a variable. NOTE Most creation commands return the name of the created object as a return value. This value can be stored as a variable to refer to the object at a later time. This is especially useful when referring to controls within a user interface. 2 Deselect the torus using a Python command. cmds.
Communicating between Python and MEL MEL and Python in Maya each have built in commands to communicate with each other. MEL and Python communicate by calling commands in the other language and evaluating the results of the last executed command. Python communicates with MEL using the eval() command. Unlike the other Python commands in this lesson, the eval() function does not belong to the Maya commands module (maya.cmds). The eval() function belongs to the maya.mel module.
7 Transfer the MEL variable’s value to Python by typing the following: TransferMELvar = maya.mel.eval("$temp=$MyMELVariable") When transferring variables between MEL and Python, the functions return the value of the statement. MEL syntax does not allow you to return the value of a variable by using the variable as a command string. In MEL, when a variable is assigned a value, the value is returned to the Script Editor.
TIP Transferring values between Python and Maya can also be accomplished by using invisible user interface elements. You can edit and query the contents of user interface elements with both scripting languages. Beyond the lesson In this lesson, you learned how to access Maya’s functionality through Python scripting commands. You can: ■ Type basic Python commands in the Script Editor to access Maya Commands. ■ Use named arguments as flags at object creation time to specify the attributes for the objects.
716
14 Assets Introduction In Maya, a container is a special type of node that can be used to encapsulate sets of related nodes. A template is an external file that specifies a common interface that can be applied to multiple containers (for example, a container of a car, a truck, and an ambulance all have similar components and can thus can have a common interface) and accessed from the Maya UI. A container with an applied template is called an asset.
GettingStarted directory as your Maya project. For more information, see Copying and setting the Maya project on page 25. 3 As you work through these lessons, remember to save your work frequently and increment the name of the file every so often (filename1, filename2, and so on). In this way you’ll have earlier versions of your work to return to should the need arise. 4 (Optional) Set the current project folder to the Assets tutorial folder by selecting File > Project > Set.
This file can be found in the Getting Started directory that you set as your Maya project: Getting Started/Assets/Firetruck.mb The scene contains a model of a fire truck split into various pieces such as the body, axles, and doors. Creating a container A container is the first building block of an asset and is used to contain related nodes in your scene. A container is not visible in the main viewport, but you can select it from the Outliner, Hypergraph Connections editor, and Asset Editor.
3 In the Create Container options window, select Edit > Reset Settings. 4 Under Create Container Effect, set the Name to Fire_truck_CNT. 5 Under the Include Options, turn on Include Shaders and Include Hierarchy, and set the hierarchy to Below (including shapes). Setting these options ensures that everything the firetruck needs to maintain its current appearance is packaged into the container. 6 In the Publish Options, turn on Root Transform and Root Attributes.
all or only a subset of the available internal attributes, allowing you to limit how much access a user has to the object contained inside. The published attributes of a container are often referred to as the container’s interface, and is useful because it allows you access to every important control for your asset in a single place. To organize objects under their containers ➤ In the Outliner, select Display > Container Contents > Under Container.
to the Rotate Y attribute of Cab_door_f_r_GRP. When one changes, both are updated. 8 Repeat steps 3 - 7 to publish the following: Node Name Published name Cab_door_f_l_GRP Front_Left_Door Cab_door_r_r_GRP Rear_Right_Door Cab_door_r_l_GRP Rear_Left_Door 9 Select Edit > Reset Settings. 10 Click Close. NOTE The Door Open attribute for each door is a custom attribute that controls the Y rotation of each door.
Unlike the doors, a fire truck’s wheels are expected to move together. For example, the wheels on the front and back axles should spin together, and the front wheels should turn together. To do this, you need to create a custom attribute to control both components at once. Then you can publish your custom attribute to the container. To turn the front wheels together 1 In the Outliner, expand Axles_GRP, then select Wheels_GRP. 2 Open the Attribute Editor by clicking .
3 Scroll to the bottom of the left column and select Front_wheel_turn. 4 In the Outliner, expand Wheels_GRP and select Wheel_f_l_GRP. 5 In the Connection Editor, click Reload Right. The right column is filled with the left wheel’s attributes. 6 In the right column, expand rotate and select rotateY. rotateY turns to italics to signify that it has been connected. 7 In the Outliner, select Wheel_f_r_GRP and repeat steps 5 and 6. If you adjust the value of Front_wheel_turn, both front wheels turn together.
5 Repeat steps 2-4 for the other 3 wheels. Now if you adjust the value of the wheel_spin attribute in the Attribute Editor or Channel Box, all four wheels spin in unison. Although, in some cases, it’s useful for the front and back wheels to be able to spin at different rates, the current setup is fine for this tutorial. Now you can publish your custom attribute to the container. You can do this directly from the Attribute Editor.
To open the Asset Editor 1 In the Outliner, select Fire_truck_CNT. 2 Select Assets > Asset Editor. The Asset Editor appears. The Asset Editor allows you to manage all the containers and templates in your scene from a single interface. From the Asset Editor you can publish and unpublish attributes, change published names, bind and unbind attributes to published names, and create templates and views. The Asset Editor is divided into two columns.
Creating Views One advantage to creating a template for your asset is that you can create multiple Views for it. You can use Views to customize which attributes certain users can see in the Maya editors. For example, you can create a View that limits an animator to only the door controls and wheel spin controls and another View to limit a shader to only the truck’s body materials and textures.
5 Click Open. The template is now displayed in the Script Editor. The template is an XML file and thus is arranged with a series of tags.
And remove the following: ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
8 Set Opacity Scale Randomize to 0.116. 9 To set the color of the nParticles when they are first emitted, click the far left circle marker of the ramp (at Selected Position 0) then click the color swatch beside Selected Color. The Color Chooser appears.
10 In the Numeric Input section, click the HSV tab. 11 In the Color Chooser, select white and add a little grey, or type the following color values into the HSV (Hue-Saturation-Value) fields: ■ H:210 ■ S: 0 ■ V: 0.95 12 To set the color of the nParticles as they continue to age, click inside the ramp to create a marker, set the Selected Position to 0.834, then click the color swatch beside Selected Color.
14 Select the far right marker of the ramp (at Selected Position 1.0) and set the color to the following color values into the HSV (Hue-Saturation-Value) fields: ■ H:191.73 ■ S: 0.084 ■ V: 0.85 15 Set Color Input to Normalized Age. As each nParticle ages, its color changes from the color specified by the left marker to the one specified by the right marker. 16 To improve the way the nParticles colors blend as they age, do the following: ■ Set Interpolation to Smooth for each marker.
To add volume to the nParticle smoke 1 In the Outliner, select nParticle_Smoke. 2 In the Attribute Editor, click the nParticle_SmokeShape tab. 3 In the Lifespan section, set Lifespan to 10. 4 In the Particle Size section, set Radius to 6.5. 5 In the Attribute Editor, click the Emitter_Smoke1 tab. 6 In the Basic Emitter Attributes section, set Rate (Particles/Sec) to 128.4. 7 Play back the simulation.
Open the third scene for the lesson To ensure this lesson works as described, open the scene file named Smoke_Simulation_3.mb. This file is in the GettingStarted directory that you set as your Maya project: GettingStarted/nParticles/Smoke_Simulation_3.mb Fine tuning your smoke effect With nParticles, you can use dynamic wind generated by the Maya Nucleus solver to affect the motion of your particles.
Marker Selected Position Selected Value Interpolation 3 Linear 0.961 1.0 4 Play back your simulation. To add Nucleus Wind in your simulation. 1 In the Outliner, select nParticle_Smoke. 2 In the Attribute Editor, click the nucleus1 tab. 3 In the Gravity and Wind section, set Wind Speed to 0.85. Wind Speed determines the force and intensity of the wind. A higher value means a faster wind speed, which has a more pronounced effect on the smoke.
To make the smoke simulation more realistic, you can set up your effect so that the cigarette smoke is rising in the first frame of the simulation. You do this by setting the nParticle object’s initial state. To set the nParticle Object’s initial state 1 Play the simulation and stop the playback at or around frame 300. 2 In the Outliner, select nParticle_Smoke. 3 Select nSolver > Initial State > Set From Current. 4 Rewind the simulation to the start frame and play it back.
Beyond the lesson In this lesson you created an nParticle system and used Maya Fields to influence the behavior of the particles to create a smoke simulation effect. In addition, you learned how to: ■ Use a volume emitter with an nParticle system. ■ Use a Volume Axis field to create a disturbance in the path of your nParticles. You can also add other Maya fields, such as Turbulence, Radial, or Vortex fields to affect the behavior of nParticles.
Lesson 3: Creating a liquid simulation with nParticles Introduction A common use of particle systems is to simulate liquids such as flowing lava, water sprays, and mud splatters. Using nParticle Liquid Simulation attributes, you can add properties to an nParticle object so that it behaves like a liquid. For example, you can add viscosity and incompressibility properties so that the nParticles fill a volume uniformly and flow like a continuous substance.
■ Adjust nParticle Liquid Simulation attributes to create particles that look and behave like water. ■ Cache your nParticle simulation. ■ Convert a liquid simulation to an nParticle output mesh. ■ Assign mia_material_x mental ray shaders to your nParticle output mesh. ■ Render a single frame of your nParticle simulation using mental ray for Maya renderer. Lesson setup To ensure this lesson works as described, open the scene file named Liquid_Simulation_1.mb.
4 In the Particle Fill Options window, select Edit > Reset Settings. 5 From the Solver list, select Create New Solver. 6 Ensure that Resolution is set to 10. Resolution specifies how many nParticles are evenly placed along the geometry’s longest axis. 7 Ensure that Close Packing is on. 8 Turn on Double Walled. Turning on Double Walled ensures that the thickness of the pitcher geometry is taken into account when it is filled with nParticles.
10 In the Outliner, double-click nParticle1 and type nParticle_Water to rename it, then press Enter . Renaming your nParticle object makes it easier to identify when you have more than one in your scene. In this lesson, both the pitcher and the glass mesh will hold nParticles, so you must convert meshes to passive collision objects and assign them to the same Nucleus system as the nParticles.
3 From the Solver list, select nucleus1. 4 Click Make Collide. 5 Rename the pitcher and glass nRigid objects in the Outliner. For example, rename nRigid1 and nRigid2as nRigid_Pitcher and nRigid_Glass respectively. 6 Play back the simulation. When you play back the simulation, notice that the nParticles do not behave as you might expect. Rather than immediately falling to the bottom of the pitcher like water, they fall slowly, as if the simulation is playing in slow motion.
When you play back the simulation, notice that the nParticles are still contained in the pitcher, but they occupy a small amount of the pitcher’s volume. Also, the nParticles appear to be pushing down as if they are under a force of pressure or compression. In the next section, you begin adjusting the Liquid Simulation attributes that make the nParticles look and behave more like a liquid.
Adjusting the liquid volume To set Liquid Radius Scale and create liquid volume 1 In the Outliner, select nParticle_Water. 2 In the Attribute Editor, click the nParticle_WaterShape tab. 3 In the Liquid Simulation section, ensure that Enable Liquid Simulation is on. 4 Set Liquid Radius Scale to 2.0. 5 Play back the simulation. The nParticles are now stacked on top of each other, creating more volume in the pitcher. For this liquid simulation, you want the nParticles to fill one-third of the pitcher.
■ In the Solver Attributes section, set Substeps to 7. ■ Set Max Collision Iterations to 10. 7 Play back the simulation. The nParticles now fill the water pitcher, and when the pitcher tilts to pour, the nParticles have enough volume to exit and fill the glass. More about Liquid Radius Scale Be aware that Liquid Radius Scale can be affected by other nParticle attributes such as Radius and Collide Width Scale.
3 In the Collisions section, select Collision Thickness from the Solver Display list. 4 Set Collide Width Scale to 0.6. For liquid simulations, set Collide Width Scale to a value that is one-third the nParticle object Radius value. 5 Play the simulation, and stop at frame 40. 6 In the scene view, dolly and tumble so that you get a close-up view of the nParticles at the bottom of the pitcher. The nParticles occupy the pitcher in two distinct layers one on top of the other.
To set Incompressibility 1 In the Outliner, select nParticle_Water. 2 In the Attribute Editor, click the nParticle_WaterShape tab. 3 In the Liquid Simulation section, set Incompressibility to 20. 4 Play back the simulation. More about Liquid Simulation attributes For this tutorial, you leave the following Liquid Simulation attributes at their default values: ■ Viscosity: 0.1 ■ Rest Density: 2.0 You can experiment with Rest Density by setting it to 0.5 and then to 4.0.
For more information about these attributes, see Viscosity and Rest Density in the nDynamics guide. Open the second scene for the lesson To ensure this lesson works as described, open the scene file named Liquid_Simulation_2.mb. This file is in the GettingStarted directory that you set as your Maya project: GettingStarted/nParticles/Liquid_Simulation_2.mb Convert nParticles to a polygon mesh To create a smooth surface for your liquid simulation, you can convert the nParticles to a polygon mesh.
For a realistic effect, you want the water to be motionless at the bottom of the pitcher at the start of the simulation. To set the initial state of the nParticles 1 Play the simulation and stop the playback at or around frame 30. 2 In the Outliner, select nParticle_Water. 3 Select nSolver > Initial State > Set From Current. 4 Rewind the simulation to the start frame. To convert your nParticle object to a polygon mesh 1 In the Outliner, select nParticle_Water.
5 In the Output Mesh section, set Blobby Radius Scale to 3.5. In the scene view, the nParticle output mesh is superimposed over your nParticle object. 6 In the Output Mesh section, select Quads from the Mesh Method list. Selecting Quads creates your converted mesh using quad-based polygons, while Tetrahedra, Cubes, and AcuteTetrahedra create meshes using triangulated polygons. Output meshes that are quad-based respond better to polygon smoothing (Mesh > Smooth) than triangle-based output meshes.
■ Set Threshold to 1.5. At this value, the nParticle output mesh cuts into the nParticle object, and no longer surrounds the nParticles. ■ Set Threshold 0.6. 8 Set Mesh Triangle Size to 0.2.
This setting determines the size of the triangles used to create the mesh. Small values produce higher resolution meshes with smoother surfaces. Be aware that higher resolution meshes take more time to simulate. 9 To apply smoothing to the corners of the mesh quads, set Mesh Smoothing Iterations to 2. The output mesh is noticeably smoother. Cache your nParticle simulation When you play back the simulation, notice that it plays back much slower than before.
The Create nCache Options window appears. 4 In the Create nCache Options window, do the following: ■ Set the Cache directory to the folder where you want your caches saved. ■ Set the Cache name to LiquidSimulationCache. ■ For File distribution, select One file. ■ Click Create. Maya plays the scene automatically and stores the frames in the directory you specified. 5 When it is finished, play back the simulation. Notice that the scene now plays back faster.
To set Motion Streak 1 Go to frame 119, then dolly and tumble the scene so that you have a close-up view of the water nParticles pouring into the glass. 2 Show the Water_Mesh object by selecting it in the Outliner and selecting Display > Show > Show Selection. At this frame, notice that the droplet mesh pouring into the glass looks too spherical. It does not resemble the continuous flowing behavior of water poured into a glass.
5 Select the mesh then, from the Polygons menu set, select Mesh > Smooth. The mesh is noticeably smoother and looks more like a liquid. In the next section, you will assign material shaders to the pitcher, glass, and water meshes. You will then render single frames of the simulation using mental ray for Maya. Open the third scene for the lesson To ensure this lesson works as described, open the scene file named Liquid_Simulation_3.mb.
Render your liquid simulation In this section, you render your nParticle effect using the mental ray for Maya renderer. Since rendering a particle effect can take several minutes to an hour, in this lesson, you only render selected frames of the simulation. Rendering simulated frames is the easiest way to see how some attributes affect your simulation. To prepare your scene for rendering, you assign mental ray mia_material_x shaders to the pitcher, glass, and water meshes.
4 Go to the beginning of the playback range. To change the view arrangement and display hidden objects 1 Select Windows > Saved Layouts > Hypershade/Render/Persp. The Hypergraph, Render View, and the current perspective view are displayed. This view arrangement makes it easier to assign shaders to your objects and to view rendered frames of your simulation. 2 Open the Outliner in a separate window by selecting Window > Outliner.
A mia_material_x material swatch appears in the Work Area tab of the Hypershade, and the material attributes appear in the Attribute Editor. 4 In the Attribute Editor, rename the material to mia_material_pitcher. 5 Click and hold the Presets button, select GlassThin, then Replace (GlassThin > Replace). 6 In the Refraction section, click the color swatch beside Color. The Color Chooser appears. 7 In the Color Chooser, type the following color values into the RGB fields: ■ R: 0.190 ■ G: 0.574 ■ B: 0.
11 Assign materials to the glass and water meshes by repeating steps 3 to 10 using the following settings: For the glass (geo_glass) mesh: ■ Rename the material to mia_material_glass. ■ Select Presets > GlassThin > Replace. ■ In the Refraction section, set Color to R: 0.797, G: 0.875, and B: 0.915. For the water (Water_Mesh) mesh: ■ Rename the material to mia_material_water. ■ Select Presets > Water > Replace. ■ In the Diffuse section, set Color to R: 0.164, G: 0.512, B: 0.402.
You will render this frame where the water nParticles pour into the glass. 2 In the Render View, select Options > Render Settings . The Render Settings window appears. 3 From the Render Using list, select mental ray. 4 Click the Common tab and set the following: ■ In the Renderable Cameras section, select renderCam from the Renderable Camera list. ■ In the Image Size section, select 320×240 from the Presets list.
You can continue to make changes to the render settings, change the renderCam view, or select another simulated frame to render. After you are satisfied with your render settings, you can render the frame as a full-size image. To render a full-size image 1 In the Render View, select Options > Render Settings. 2 Click the Common tab and in the Image Size section, select 640×480 from the Presets list. 3 From the Rendering menu set, select Render > Render Current Frame.
■ Adjust Liquid Simulation attributes to set the volume and fluidity characteristics of your liquid nParticles. You can continue to adjust the Liquid Simulation attributes, such as Liquid Radius Scale and Viscosity, to create liquid simulations of thicker substances such as oil, mud, or lava. ■ Create and play back nParticle caches. ■ Convert your nParticle object to a polygon mesh.
978
20 Live Introduction Maya® LiveTM simplifies the process of matchmoving. Matchmoving is a process where you match the camera or object movement in a live-action shot with the camera in Maya. This subsequently lets you place your 3D objects into live-action footage. Matchmoving is an iterative process where the camera movement for the Maya camera is calculated using processes of tracking and solving.
Live can also match the movement of objects in the live-action shot. Suppose you want to replace the hat of a moving, live-action person with a cartoon hat created in Maya. You can use Live to create 3D locators that follow the movement of certain points on the live-action hat. You then attach a hat created in Maya to these moving points, so that the rendered Maya hat follows the movements of the live-action person. The steps for matching object movement are about the same as matching the camera.
Track In this task, you mark a variety of points within the images, such as the center of a flower or a mark on the fence, and have Maya track how they change position from frame to frame. Solve In this task, you run a solver program that computes an animated camera, based on the movement of the track points. Fine Tune This is an optional task where you can make frame-by-frame adjustments to the camera position. (This task is rarely used and is not covered by this lesson.
2 Select Window > Settings/Preferences > Preferences. Click the Timeline category under Settings and make sure the Playback Speed is set to Play every frame. Animation plays more accurately with this setting. 3 Locate the Live Lesson Data at http://www.autodesk.com/maya-training in the Tutorials section. You’ll need about 300 Mb of disk space and a program (such as Winzip) to extract the .zip file.
Lesson setup You begin the lesson by loading digital images of a live-action sequence. You’ll work with images we created for your use. To load and set up the images for the lesson 1 If you haven’t already done so, download and extract the Maya Live Lesson Data at http://www.autodesk.com/maya-training in the Tutorials section. 2 In the Setup control panel, click the Browse button next to the Full Res Image box.
■ Position tracking points for the live-action footage. ■ Track points in the scene ■ Evaluate how closely points are tracked using the Track Summary panel. ■ Modify the location of tracking points for a scene. ■ Import track points into Maya. ■ Solve for the camera movement. ■ Evaluate and modify the solution that the Solver creates. Tracking provides Live with information about the way objects in the shot appear to move.
2 Play the shot and watch it in the shotCamera view panel. Don’t worry if the playback seems jerky, because you are only getting a rough look at how the camera moves. In fact, you can skip through the frames quickly by dragging in the Time Slider. NOTE Playing shots can be slow because the images require a lot of memory. To speed up playback, Live has settings for creating an image cache (Setup Cache control panel).
Tracking object points in a shot In the next steps, you track the motion of a flower. Tracking points on the ground is common practice and the flowers are easy targets to track. To track objects in the shot 1 Go to frame 1. 2 Click the Create button in the Track control panel. Live places a track box in the center of the shotCamera view, ready for you to reposition.
If you switch to another tool, such as rotate, remember to select the track box tool again if you thereafter need to move track boxes. 5 In the shotCamera1 view, drag the track box down to the fourth clump of flowers from the right. This pair of flowers is good to track because it is visible in all frames. Strive to track points that are visible for a large number of frames. 6 In the pointCenteredCamera view, drag the image until the track box cross-hair is centered over the flower closest to the fence.
Notice that the track box resizes if you drag the edges. For this track point, keep the boxes at the default size. Choose Edit > Undo if you resize it accidentally. It may require a number of Undo commands to return to the original configuration of the track box. The point you are tracking is at the center of the track box cross-hair. To track this point, Live uses the pattern of pixels defined by the inner box. The outer box is the range Live searches for the target pattern.
Evaluating the tracking of a point Making sure the track point stays on target will help later when you solve. Don’t worry if the connection between tracking and solving is not clear yet. For now, simply identify major tracking errors by following these steps: To evaluate the flower1 track 1 Review the movie file that Live generates at the end of tracking. Identify any areas where the cross-hair slips noticeably from the original position on the flower. This takes some judgment.
This graph shows how closely Live matched the track box’s pixel pattern on each frame. Specifically, Live compares each frame and the frame before it to see how well they match. Green is a good match, yellow is a warning, and red is a stronger warning. As illustrated, the green region drops over time, leaving the graph mostly yellow toward the end. This is a normal occurrence, caused by the changing pixel pattern of the point you tracked.
3 In the PointCenteredCamera view, position the track box to match the following illustration. Knowing where to position the track box involves two important factors. One factor is the pattern framed by the inner target box. This pattern must have at least some contrast and must be distinct from the surrounding region that is framed by the outer box. By having a distinct pattern within the inner target, you will prevent the tracker from jumping off target and onto a similar pattern.
Deleting tracking data Because the fence corner disappears from view in the middle of the shot, you need to skip several frames and track from where it reappears. First, you need to remove the bad tracking data where the track box moves off target. To delete the bad tracking at the end, you use the Track Summary panel (the panel below the pointCenteredCamera view). To delete the bad tracking data 1 To see fenceCorner’s tracking graph better, click the Track Summary panel and tap the space bar.
creating track points. In general, track as many frames as possible for each point and skip, retrack, or delete any frames where the tracker does not stay on target. 2 Reposition the track box over the fence corner. In the pointCenteredCamera view, align the vertical cross-hair line with the edge of the fence post and the horizontal cross-hair line with the bottom of the post. 3 Shorten the track box’s inner target box by clicking the inner target box’s bottom edge and dragging up as shown below.
illustration. (The second track area will be mostly green or all green in the Track Summary.) If the tracker fails to create a graph similar to the above illustration, three actions might have occurred: ■ The tracker stays stuck at the same frame and the animation frame doesn’t advance ■ The tracker stops before the final frame ■ The tracker drifts off target Whichever of these actions occurred, repeat the previous step, but this time shorten the track box’s inner target box.
To decide if you are ready to solve for the camera movement 1 In the Track Summary panel, choose View > Frame All. 2 For each frame, make sure there are at least four points with graphed tracked data. Experience has shown that four points is the minimum average you need to solve a shot. In the middle frames, such as frame 135, there is less track data. However, on this frame and all frames in the middle, there are at least four. 3 Look for large areas of red in each track point’s graph.
Solving the shot The solver is the part of Live that animates a Maya camera. You rarely obtain a correct solution the first time you run the solver. Once the solver is run, you need to evaluate the solution and make improvements to the track data until the solver can create a correct solution. To solve the shot 1 Open the Solve control panel by clicking the control panel menu on the far left and choosing Solve.
When the solver finishes, the solution, called solution_rf, appears in the solution list on the Solve control panel. Because you will run the solver several times, Live keeps a list of each solve attempt. A solution consists of an animated camera and locators, which appear as crossed lines in the perspective view. Locators are marks in the world space that you can use as reference points when modeling.
Ideally, Overall Pixel Slip should be less than 2. But this doesn’t mean the solution will mimic the live footage camera movement satisfactorily. In the next steps, you’ll find out whether it does. If Overall Pixel Slip reads “poor” or a number higher than 2, you need to fix a problem in your track points. Return to the Track control panel and repeat the instructions Preparing to solve on page 994.
If one point had a very red and yellow graph, you could conclude that the point was the source of the problem solution. In this case, many points have red and yellow areas, but those areas appear mainly in the first 100 frames. Because red and yellow areas all occur within the first 100 frames, you can conclude that the solver does not have enough information for those frames. To improve the information, you’ll need to add one or more track points for those frames.
While the solver runs, examine the following illustration to learn about the points you just loaded and why they were chosen to improve the solution. In general, having a diversity of points, such as points far and near the camera, is critical to helping the solver. 4 When the solver finishes, solution_rf1 appears in the solution list. Check the Overall Pixel Slip in the Solve control panel. It reads about 0.322, so the new points have made an improvement.
At this point, you can assume that your matchmove is complete and accurate. However, to be absolutely sure, you need to play the animation with a model placed in front of the camera. If the model does not appear to slip relative to the background, then your matchmove is accurate. To learn about this type of testing, continue with the next lesson. 6 If you plan to continue with the next lesson, we recommend you first save your scene into the current scenes directory.
are not accurate. Even if one track point is off alignment on one frame, it could result in an incorrect solution. Your solution has the correct camera movement, but you may wonder why the camera and locators are placed below the perspective view grid. If you want to control where the solution is placed within the scene, you need to give the solver more information, called survey constraints. Continue with the next lesson to learn more.
In this lesson, you learn how to change the positioning of the camera and locators within the Maya scene. You typically need to do this so you can more easily model and animate objects you want to match up with the live shot. You will learn how to: ■ Create a variety of survey constraints. ■ Apply survey constraints to the solution. ■ Evaluate the solution with imported geometry.
until you run the solver again and create a new solution. You will do this later in the lesson. This constraint is not based on a film set measurement; it is simply an estimate. Using estimates to control the space between locators is often useful, but be careful not to use too many estimates. Too many estimates can prevent the solver from finding a solution. Creating a Plane constraint In addition to the space between locators, you may want them to be repositioned within the scene.
4 In the Solve Survey control panel, change the Name setting to ground. Because you will later create another Plane constraint, you should give this constraint a unique name. Registering a solution To incorporate your survey constraints, you could solve from scratch (click Solve). However, you do not need to. You already have an accurate solution; you only want to incorporate the survey constraints. For this reason, Live lets you run the last step of solving: Register.
If you dolly in the view, you’ll also see that the locators for the points you constrained by distance—fenceCorner and tileInFront—are now about two grid units apart. Creating additional Plane constraints A top view reveals an illogical placement of the fence locators. Instead of being aligned with the XY plane, they are at an angle. To correct this problem, you need another Plane constraint that represents the fence.
3 Select the following track points in the Outliner under clip1TrackedPointVisibilityGroup > clip1TrackedPointGroup: ■ fenceCorner ■ fenceX4 ■ fenceX1 ■ fenceRailSpot ■ fencePostEdge ■ fenceleft1 ■ fenceleft2 These are the points that are on the front of the fence. 4 Click Create. 5 Change the Name setting to fence. 6 In the Channel Box, rotate the fence plane by entering 90 in the Rotate X attribute.
Evaluating the solution with imported geometry The best evaluation of your solution is to set an object in front of the solved camera and see if it matches the background as you play the animation. In this case, we will import a fence modeled in Maya. Before you load the modeled fence, do the following steps to add one more survey constraint. You add a Point constraint to orient the solution so fenceCorner is at the origin.
To import a modeled fence 1 Choose File > Import. 2 Navigate to the MayaLiveLessonData/scenes directory in the Import browse window. 3 Double-click fenceModel.ma to import it. To evaluate the solution 1 Hide the Plane constraints by selecting them and choosing Display > Hide, Show > Hide Selection By hiding them, you can see the fence better. 2 Enlarge the shotCamera view panel, which is in the upper right of the Solve panel layout. This panel shows the view from the solved Maya camera.
The Playblast movie is an approximation of how the rendered sequence will appear. In this movie, you can look for subtle mismatches between the model and the background, such as momentary jitter. NOTE As an alternative to the Playblast, you could play the animation in Maya, provided you allocate enough memory in the Setup Cache control panel. If you have memory allocated for all 240 frames, the playback will be as fast and accurate as the Playblast movie.
Index { } in expressions % in expressions 641 648 2D fluid container creating 792 3D fluid container creating 801, 810 3D Paint Tool 610 A Accuracy 531 active rigid body 558 Add Attribute button 645 Add Attributes 548 for Current Render Type 547 Add Dynamic Attributes 548, 645 Add Influence 341 Add Keys Tool 212 Add Per Particle Attribute 548, 645 Add Preview Plane 821 Add/Edit Contents 792, 797, 811 age, particles 549 Along Axis 540 Alpha Gain 77 Amplitude 805 animation curves 206 planning, storyboardin
Billow Density 805 birth, particles 549 blend modes 611 blend shape deformer 352 adding shape to 357 editor 353 improving deformations 359 blending animation types 231 Blinn shading material 441, 443 description 67 Blobby Radius Scale, nParticles 965 Blur, 3D Paint 617 boat locator 825 boat wakes 827 bones 319 Boolean operations 129 border edges 84 Bounce 925–926 Boundary Draw 808 Boundary X, Y 796 Bounding Box 214 braces, in statements 641 brackets, double angle 646 Break Tangents Graph Editor 208 Bridge 1
clips applications 242 audio 275 blending 274 components 245 creating 244, 247 cycling 261 description 239, 242 duration 246 importing 253 inserting 270 keyframing 275 name 246 Outliner 275 regular clips 244 renaming 248 repositioning 250 reusing 253 scale 246 scaling 257 source 244, 253 Visor 275 cloth texture 446–447 Clump Width hair 772 cluster deformer 346 cluster handle 348 cluster weights 349 Collapse 294 collapse hierarchy 294 Collide Sphere 768 Collide Width Scale 926, 928, 960 Collision Flag 876–87
Create Expression Editor 628 Create 2D Container 792 Create 2D Container with Emitter 793 Create 3D Container 802, 810 Create Blend Shape 352 Create Clip options 261–262 Create Cluster 348 Create Constraint 556 hair 768, 785 Create Hair 758, 779 Create Ocean 820 Create Polygon Tool 95 Create Ramp 549 Create Rest Curves hair 759 creating constraints 881–886, 908–909 liquid simulations 953, 976 nCloth 866–868, 895 nParticles 918, 920, 931, 933 passive collision objects 868, 897 creation expressions 645 assign
driven keys description 215 duplicate symmetrical 831 Duplicate Tool 174 description 39, 55 options 39, 48 Duration 246 dynamic attributes adding 546, 644 dynamic curves 777 hair 753 dynamic fluid behavior, changing 794 Contents Method 795 creating (3D) 810 description 791 Dynamic Grid 794, 797, 812, 816 Dynamic Properties 892, 895 dynamics definition 535 E Eccentricity 824 Edge Bounded hair 759 edge loop 84 description 84 termination 115 edges border 84 creasing 123 hardening 123 selecting subdivision sur
Fill Object, nParticles 954 filmback for Live 983 fingernails 193 fingers 185 Flipbooks 553 floating geometry 825 Flood 815, 847 Sculpt Geometry Tool 161 Flood All 613 fluid container boundaries 793 creating 792, 801, 810 fluid dynamics 791 fluid properties 792 adding constant values 803 emitting 792 painting 811 Fluid Slice Location 813 fluids attributes, changing 794 color 797 deforming geometry with 800 emitting 792 emitting from surface 800 forces 793 painting properties 811 resolution 802 self-shadowin
Go to Bind Pose 340 Graph Editor 205 path animation 227 Set Driven Key 219 tangent modification 228 Gravity 557, 584, 795, 892 hair 761, 766 Gravity and Wind 949 ground plane 579 group nodes animating 214 Group Under 345 grouping objects description 52 Growth attributes 605 H hair assigning a Paint Effects brush 782 colliding with objects 782 constraining 784 creating 758 creating Rest curves 765 improving playback performance 761 modifying 772 Paint Hair Tool 754 playing the hair simulation 760 rendering
IK Rotate Plane handle 331 IK Solvers Enable and Disable 340 ikSCsolver 289 image cache in Live 985, 1010 image plane description 75 importing 76 transparency 77 image plane and rendering 1002 image size 505, 515, 524 Import Clip 253 Import Tracked Points 994, 999 Incandescence 818 Incandescence1 617 Inclination 841, 853 Incompressibility 961 Influence list Paint Skin Weights Tool 337 influence object smooth skin 340 initial orientation hinge constraint 557 Initial State 905–907 Input Mesh Attract 902 Inser
Length Flex hair 766 level of detail subdivision surface 191 lifespan attribute 549 Lifespan, nParticles 935 lights add to a scene 856 applications 485 attributes 491 directional 586 dropoff 492 intensity 586 penumbra 492 spotlight 488, 506 spotlights 856 Line Smoothing 552 Line Width 547 Linear Graph Editor tangents 208 linking attributes 631 Liquid Radius Scale 959 Liquid Simulation attributes 958, 963 Live control panels 982 solver 997 starting 982 Load Driver Set Driven Key 217 Load Selected Characters
Maya Vector renderer description 451 mayaLive.mll 982 mayalive.
description 791 non-hair simulation 777 non-proportional scaling 50 nonlinear animation description 239 normals reversing 839 surface 160, 838 Normals Harden Edge 125 Soften Edge 124 nParticle tutorials creating nParticles 917 overview 916 simulating liquids 953 simulating smoke 930 nParticles Blobby Radius Scale 965 Bounce 925–926 caching 967 Collide Width Scale 926, 928, 960 collisions 925–926, 960 Color 923 converting to polygons 963–967 creating 918–920, 931–933 creating liquid simulations 953–976 emiss
origin 18 orthographic view 43 Outliner 244, 248, 275, 859 description 153, 178 parenting objects 178 placing clips from 254 Output hair 754 Output Mesh, nParticles 965 Output window 457 Overall Pixel Slip 997 Oversample 771 Oversample Post Filter 771 P paint brushes blending 572 Paint Effects 3D objects 589, 593 applications 607 Brush Settings window 617 brushes, 3D Paint 615 making surfaces paintable 594 panel 587 Paint Effects hair 754, 771 Paint Effects to Polygons 601 Paint Fluids Tool 811 Paint Fur A
description 508 Emit Photons 509 Global Illum Photons 509 Max Photon Depth 529 Photon Intensity 509, 512, 530 photon maps 533 Photon Refractions 529 Radius 531 Pitch 826 pivot point description 57 Plane constraint 1004 playback animation 313 controls 202 quickening 213 speed 202 Playblast 205, 213 description 237 Playblast for matchmoving 1010 Plug-in Manager 982 Fur 830 point constraint description 294 Point constraint 1008 Point Method 785 Points Per Hair 759 Polar 841 pole surface 162 Pole Vector Constra
Redirect Tool 266 creating redirect control 266 keyframing control 268 positioning control 267 reduce fur length 843 reference layer 835, 851 Refine Selected Components 194, 196 reflect Paint Fur Attributes Tool 848 Reflection Sculpt Geometry Tool 165 Reflection X 612 refractions Max Trace Depth 529 photon refraction 529 refraction levels 529 Register step 1005 renaming clips 248 renaming surfaces 833 render a scene 860 Render Current Frame 585 render image plane 1002 Render Sequence 552 Render Settings 458
scale non-proportional 50 Scale Paint Skin Weights Tool 339 scale, multiplying by percentage 642 scaling clips 257 scene painting view 587 scene view vs Render View 451 Scraggle fur setting 853 scrub 203 Sculpt Geometry Tool 156, 159 basic techniques 159 preparing surfaces 157 sculpting terrain 592 Section Radius 543 Selected Position 807 selection border edges 89 Convert Selection 97 faces 82 hierarchy 57 hierarchy, object, component 56 masks and modes 22, 56 mode 22 objects 24, 34, 120 Paint Selection Too
Paint Fur Attributes Tool 847 Paint Skin Weights Tool 339 Smooth Bind 335 Smooth Shade All 80, 441 smooth skin 335 influence object 340 unnatural deformation 336 smoothing polygons 79, 121 Snap Mode 22 Snap to Grid 85 Snap to Points 173 Soft Modification Tool 130 Soften Edge 124 Software renderer description 450 software rendering 450 solo track 256 Solve control panel 996 solver for Live 997 source clip 244 Source In 246 Source Out 246 Space Scale 901, 922, 957 spans, displaying 158 Specular hair 775 Specu
subvolume manipulators 811 summary track description 255 surface material 67 normals 160 pole 162 surface render 800 surfaces normals 838 survey constraints 1002, 1010 Survey option 1003 symmetry 82 syntax, errors 637 T Tail Fade 547 Tail Size 547 Tangent Graph Editor 214 handles in Graph Editor 208 Tangential Drag 893 target blend shape 352 Temperature fluid property 792 painting 816 template brush description 566, 578 modifying settings 566 resizing 566 template display 60, 319 applications 60 descriptio
clip manipulator 258 cycling a clip 264 Graph Anim Curves 252 Load Selected Characters 245 motion capture data 259 mute track 257 Offset attribute 265 panel layout 241 repositioning clips 250 scaling clips 257 solo track 256 summary track 255 time warps 275 Toolbar 247 track 245 triplanar projection 376 tubes attributes 604 Creation 599 editing attributes 570 Flower 599 Leaves 599 Tumble Tool description 45 turbulence 795 Turbulence options 595 Twist 331 hair 764 Twist attribute 230 Two Panes Stacked 619 U
Visor 244, 275 description 254 placing clips from 254 preset brushes 577, 593 volume axis field 539 Volume Axis field 940–942 volume pixels 794 Volume Shape 539 voxels 794, 802 W Wakes creation 827 water open 819 Wave Length Max 823 Wave Peaking 823 Wind Speed 892 Wireframe on Shaded mode 80 workspace 17 world space coordinates 93 X X-Ray 81, 335 X, Y, Z axes 19 axis indicator origin 18 X, Y, Z Resolution X, Y, Z Size 802 X, Z ground plane 19 802 579 Index | 1029
1030