Appendix A. The Bottom Line

Each of The Bottom Line sections in the chapters suggest exercises to deepen skills and understanding. Sometimes there is only one possible solution, but often you are encouraged to use your skills and creativity to create something that builds on what you know and lets you explore one of many possible solutions.

Chapter 1: Working in Maya

Understand transform and shape nodes.

DAG nodes have both a transform and a shape node. The transform node tells where an object is located; the shape node describes how it is made. Nodes can be parented to each other to form a hierarchy.

Master it

Arrange the nodes in the miniGun_v03.ma file in a hierarchical structure so the barrels of the guns can rotate on their Z axis, the guns can be aimed independently, and the guns rotate with the turret.

Solution

In the Outliner, MMB-drag the left_gunBarrels node onto the left_housing node. MMB-drag the left housing node onto left_mount, then MMB-drag left mount onto the turret node. Do the same for the right gunBarrels, housing, and mount nodes. Graph the node structure on the Hypergraph, and examine the network.

Create a project

Creating a project directory structure keeps Maya scene files and connected external files organized to ensure the animation project is efficient.

Master it

Create a new project named Test, but make sure the project has only the scene, source images, and data subfolders.

Solution

Use the Options box in the Create New Project command to make a new project named Test; leave all the fields blank except for scenes, source images, and data. Name the folders in these fields scenes, sourceImages, and data, respectively.

Use assets

An asset is a container in which the contained nodes have specific attributes published to the top level of the container. This means that members of each team in a pipeline have easy access to the attributes they need, thus streamlining production.

Master it

Create an asset from the nodes in the miniGun_v04.ma scene in the chapter1scenes folder. Make sure that only the Y rotation of the turret, the X rotation of the guns, and the Z rotation of the gun barrels are available to the animator.

Solution

Create a container that holds the turretAim curve and turret nodes (and their child nodes). Use the Asset Editor to publish the Rotate Y, Rotate X, and Barrel Spin attributes of the turretAim curve node to the container. Set the container to black box mode so the animator can't access any of the attributes of the contained nodes.

Create file references

File references can be used so that as part of the team works on a model, the other members of the team can use it in the scene. As changes to the original file are made, the referenced file in other scenes will update automatically.

Master it

Create a file reference for the miniGun_v04.ma scene; create a proxy from the miniGun_loRes.ma scene.

Solution

Create a new scene and reference the miniGun_v04.ma file in the chapter1scenes directory. Use the Reference Editor to make a proxy from the miniGun_loRes.ma scene in the same folder on the DVD.

Chapter 2: MAYA CAMERAS

Determine image size and resolution

The final image size of your render should be determined at the earliest possible stage in a project. It will affect everything from texture resolution to render time. Maya has a number of presets that can be used to set the image resolution.

Master it

Set up an animation that will be rendered to be displayed on a high-definition progressive-scan television.

Solution

Open the Render settings and choose the HD 1080 preset under the Image Size presets on the Common tab. Progressive scan means the image will not be interlaced (rendered as alternating fields), so you can render at 24 frames per second. Open the Preferences/Settings window and set the Time setting under Settings to Film (24 FPS).

Work with camera settings

The settings found in the Attribute Editor for a camera enable you to replicate real-world cameras as well as add effects such as camera shaking.

Master it

Create a camera setting where the film back shakes back and forth in the camera. Set up a system where the amount of shaking can be animated over time.

Solution

Enable the Shake Overscan attribute on a camera. Attach a fractal texture to the Shake Overscan attribute and edit its amplitude settings. Create an expression that sets the Alpha Offset to minus one-half of the Alpha Gain. Set keyframes on the Alpha Gain to animate the shaking of the Shake Overscan attribute over time.

Create custom camera rigs

Dramatic camera moves are easier to create and animate when you build a custom camera rig.

Master it

Create a camera in the car chase scene that films from the point of view of chopperAnim3 but tracks the car as it moves along the road.

Solution

Create a two-node camera (Camera and Aim). Attach the camera to a NURBS curve using a motion path, and parent the curve to chopperAnim3. Parent the aim of the camera to the vehicleAnim group. Create an asset for the camera so that the position of the camera around the helicopter can be changed as well as the position of the aim node relative to the vehicleAnim group.

Use Depth of Field and Motion Blur

Depth of Field and Motion Blur replicate real-world camera effects and can add a lot of drama to a scene. Both are very expensive to render and should be applied with care.

Master it

Create a camera asset with a built-in focus distance control.

Solution

Create the same camera and focus distance control as shown in this chapter. Select the camera, camera shape node, and distance controls, and place them within a container. Publish the Z Translation of the distToCam locator to the container. Publish the F Stop and Focus Region Scale attributes as well.

Create orthographic and stereoscopic cameras

Orthographic cameras are used primarily for modeling because they lack a sense of depth or a vanishing point. A stereoscopic rig uses three cameras and special parallax controls that enable you to render 3D movies from Maya.

Master it

Create a 3D movie from the point of view of the driver in the chase scene.

Solution

Create a stereo camera rig, and parent it to the car in the chase scene. Use the center camera to position the rig above the car's cockpit.

Chapter 3: NURBS MODELING IN MAYA

Use image planes

Image planes can be used to position images for use as a modeling guide.

Master it

Create image planes for side, front, and top views for use as a model guide.

Solution

Create reference drawings or use photographs taken from each view. Save the images to your local disk. Create image planes for the front, side, and top views, and apply the corresponding reference images to each image plane. Use the settings in each image plane's Attribute Editor to position the image planes in the scene. Use display layers for each plane so their visibility can be turned on and off easily.

Apply NURBS curves and surfaces

NURBS surfaces are created by lofting a surface across a series of curves. The curve and surface degree and parameterization affect the shape of the resulting surface.

Master it

What is the difference between a 1-degree (linear) surface, a 3-degree (cubic) surface, and a 5-degree surface?

Solution

The degree of the surface is determined by the number of CVs per span minus one, so a 1-degree surface has two CVs per span, a 3-degree surface has four CVs per span, and a 5-degree surface has six CVs per span. Linear and cubic surfaces are the ones used most frequently.

Model with NURBS surfaces

A variety of tools and techniques can be used to model surfaces with NURBS. Hard-surface/mechanical objects are well-suited subjects for NURBS surfaces.

Master it

Create a NURBS model of a common object you own such as a cell phone, a computer monitor, or a particle accelerator.

Solution

Start with drawings or photographs of the object and place them on image planes. Use whichever techniques described in this chapter work best for you to create the object. Remember to combine tools and techniques and use the construction history to your advantage.

Create realistic surfaces

Manufactured objects usually have visible seams and parting lines that reveal how they are put together. Adding these details to your surfaces greatly increases the realism of your objects.

Master it

Examine a manufactured object closely, and pay attention to the seams and parting lines. Look at weather stripping on the windows of vehicles; look at the trim around tail lights and openings in the surface. Look at the panels on the underside of electronic products such as a cell phone. Try to imitate these in your models even if the object does not exist in the real world.

Solution

Use intersecting surfaces, curves projected or drawn on a surface, and the Trim tool to create parting lines and seams around panels. Use lofts and freeform fillets to bridge gaps between surfaces. Manipulate the hulls on the lofts and fillets to change the shape of the surfaces.

Adjust NURBS render tessellation

You can change how the rendering engine converts a NURBS surface into triangles at render time by adjusting the tessellation of the objects. This can impact render times and increase efficiency in heavy scenes.

Master it

Test the tessellation settings on a row of NURBS columns. Compare render times and image quality using different tessellation settings.

Solution

Create a row of identical NURBS Greek columns using a revolve surface. Place a camera in the scene that looks down the row of columns. Compare render times and quality when you lower or raise the tessellation of surfaces far away and close to the camera. Use the Display Render Tessellation feature, the Attribute Editor, or the surfaces so that you can visualize the difference in tessellation.

Chapter 4: Polygon and Subdivision Surface Modeling

Understand polygon geometry

Polygon geometry consists of flat faces connected and shaped to form three-dimensional objects. You can edit the geometry by transforming the vertices, edges, and faces that make up the surface of the model.

Master it

Examine the polygon primitives in the Create

Chapter 4: Polygon and Subdivision Surface Modeling
Solution

Create an example of each primitive shown in the menu. Adjust their settings in the INPUTS section of the Channel Box. Switch to vertex selection mode, and move the vertices of each primitive to create unique shapes.

Work with smooth mesh polygons

The smooth mesh preview display allows you to work on a smoothed version of the polygon model while limiting the number of components needed to shape the model. You can use creasing to create hard edges in selected areas.

Master it

Create a backpack for the space suit character.

Solution

Create a polygon cube and activate smooth mesh preview. Use the Insert Edge Loop tool, extrude faces, and crease edges to create a backpack that fits on the back of the space suit character.

Model using deformers

Deformers such as the lattice, non-linear deformers, and the Soft Modification tool can be used to help shape geometry and groups of objects.

Master it

Create a number of small-detail objects for the belt of the space suit character. Shape the details so that they conform to the belt.

Solution

Create a number of small objects suitable for detailing the belt. Line up the objects in the front view. Group the objects, and use a combination of lattices and bend deformers to shape the objects so they conform to the circular shape of the belt.

Combine meshes

Multiple meshes can be combined under a single shape node. When this is done, you can edit the components of the combined meshes as a single mesh.

Master it

Combine two polygon spheres, and use the polygon-editing tools to join the faces of the spheres.

Solution

Create two polygon spheres. Combine the spheres (Mesh

Chapter 4: Polygon and Subdivision Surface Modeling
Use bevel tools

The Bevel tool can add a beveled edge to a polygon surface, creating more realism by smoothing the edges. The Bevel Plus tool is used primarily to create 3D logos from text curves, but it can be used to create interesting details and objects.

Master it

Using the concept sketch as a guide, create the spiraling detail for the character's boots.

Solution

Draw some spiral curves, or reuse the curves created earlier in the chapter. Use the Bevel Plus tool to create geometry from the curves. Group the geometry together, and use deformers to make the geometry conform to the shape of the boot.

Model polygons with Paint Effects

Paint Effects strokes can be converted to NURBS and Polygon geometry. Using the default brush you can quickly create hoses and wires. Because construction history connects the converted objects to the strokes, you can use the stroke settings to edit the shape of the converted objects.

Master it

Add additional hoses and wires to the space suit character.

Solution

Make the torso object live, and draw curves directly on the surface. Select the curves, and choose Paint Effects

Chapter 4: Polygon and Subdivision Surface Modeling
Convert NURBS surfaces to polygons

NURBS surfaces are frequently used as a starting place to create polygon objects, giving you the power of both types of models.

Master it

Convert the helmet object into polygons.

Solution

Select the NURBS objects and convert each to polygons. You will need to adjust the conversion options for many of the surfaces as you create them. Once you have converted all the objects, combine them into a single surface.

Use Booleans

Using Booleans you can use one polygon object to shape a second. The first object can be joined with the second or used to cut into it. An object can be created from the intersection of two objects.

Master it

Create additional detail in the torso trim surface of the space suit character using Booleans.

Solution

Use cylinders, spheres, and cubes to cut holes and create details in the torso trim object. Experiment with combinations of the different Boolean operations.

Sculpt polygons using Artisan

The Artisan toolset is a brush-based modeling and editing tool. Using Artisan you can sculpt directly on the surface of geometry.

Master it

Use Artisan to sculpt dents into a surface.

Solution

Create a polygon surface with fairly dense geometry. Choose Polygons

Chapter 4: Polygon and Subdivision Surface Modeling
Model a human head

There are a variety of techniques you can use to create a human head. Modeling character heads is one of the most difficult challenges facing 3D artists. It takes a great deal of study and practice. This chapter demonstrates creating the head by connecting parts of the faces sculpted from polygon primitives.

Master it

Take several photographs of yourself or a friend from the front and the side. Map these to image planes in a Maya scene, and create a polygon head using the photographs.

Solution

Using the image planes as a reference, start by building simple geometry around the mouth and eyes. Use the polygon tools to create the features, and then connect them together into a single mesh. Once you have the basic geometry created, sculpt the geometry of the head to match the photographs using the Move tool and the Artisan tool set.

Create a character

Once you have the basic geometry for the head created, you can use the polygon editing and sculpting tools to shape the head into any number of characters.

Master it

Use the geometry created for the head to make a different character. Try turning the head into an older man.

Solution

Use the Artisan tool set, the Transform Component, and other tools to push and pull the vertices of the head until it resembles a different character.

Use subdivision surfaces

Subdivision surfaces are similar to smooth mesh preview polygons except that specific parts of the model can be subdivided and edited as needed. You can traverse the subdivision levels while you work.

Master it

Add wrinkles, seams, and other details to the glove model.

Solution

Convert the subdivision surface version of the glove into polygons, and insert edge loops to create lines around the perimeter of the glove. Convert the glove back into subdivision surfaces. Add creasing to the inserted edge loops, and use the Move tool in tweak mode to add detail to the model. Move up to higher subdivision levels to create finer detail.

Chapter 5: Animation

Create a simple rig with joints and constraints

Joints are a deformer commonly used in character animation. The hierarchical relationship makes them useful for rigging many types of characters. When creating robots and mechanical devices, you can build a skeleton using joints and then parent the parts of the robot to the joints.

Constraints are used to constrain the channels of one object to the world space coordinates of another object. Constraints are useful as rigging tools for snapping the pivot point of one object to another.

Master it

Create a simple joint chain for a robot's arm. Use the joint chain to animate an arm made from simple polygon surfaces.

Solution

Create a joint chain using three joints—one for the upper arm, one for the forearm, and one for the wrist. Create two cylinders and a sphere. Parent each cylinder to the upper arm and forearm joints; parent the sphere to the wrist joint.

Use Inverse Kinematics

Inverse Kinematics creates a goal object, known as an End Effector, for joints in a chain. The joints in the chain orient themselves based on the translation of the goal. The IK Handle tool is used to position the End Effector.

Master it

Create an Inverse Kinematic control for a simple arm.

Solution

Create a simple arm using three joints—one for the upper arm, one for the forearm, and one for the wrist. Rotate the forearm slightly so the Inverse Kinematic solver understands which direction the joint should rotate. Freeze transformations on the joints. Activate the IK Handle tool, click on the first joint (known as the root), and then click on the wrist joint. Move around the IK Handle to bend the joint.

Animate with keyframes

A keyframe marks the state of a particular attribute at a point in time on the timeline. When a second keyframe is added to the attribute at a different point in time, Maya interpolates the values between the two keyframes, creating animation. There are a number of ways to edit keyframes using the timeline and the Channel Box.

Master it

Create a number of keyframes for the Translate channels of a simple object. Copy the keyframes to a different point in time for the object. Try copying the keyframes to the Scale channels. Try copying the keys to the Translate channels of another object.

Solution

After creating keys for the object, Shift-drag a selection on the timeline. Use the arrows in the selection box to move or scale the keys. Right-click on the keys and choose Copy. Move to a different point in time on the timeline and paste the keys. Copying, pasting, and duplicating keys to another object can be accomplished by selecting the channels in the Channel Box and using the options that appear when you right-click on the channels.

Use the Graph Editor

More sophisticated animation editing is available using the animation curve editing tools on the Graph Editor.

Master it

Create a looping animation for the mechanical bug model using as few keys as possible. The bug should leap up repeatedly and move forward with each leap.

Solution

Create keyframes on the bug's Translate Y and Translate Z channels. Set four keys on the Translate Y channel so the bug is stationary, then moves up along the Y axis, moves back down to zero, and then holds for a number of frames. In the Graph Editor, set the Post-Infinity option for the Translate Y channel to Cycle. Create a similar set of keyframes for the Translate Z channel on the same frames. Set the Post-Infinity option for Translate Z to Cycle With Offset.

Preview animations with Playblast

Playblast is a tool for viewing the animation as a flipbook without having to actually render the animation. F Check is a utility program that is included with Maya. Playblasts can be viewed in F Check.

Master it

Create a playblast of the mechBugLayers_v04.ma scene.

Solution

Open the mechBugLayers_v04.ma scene from the chapter5scenes directory on the DVD. Rewind the animation and create a playblast by choosing Windows

Chapter 5: Animation
Use driven keys

A driven key is a keyframe that uses the attributes of one object as an input instead of time. Using driven keys you can automate many parts of an animation that might otherwise be tedious.

Master it

Create an alternate automated walk cycle for the mechanical bug so that when it walks sideways (along its Translate X), the legs automatically move in a crablike fashion.

Solution

Use the same techniques used to create the walk cycle described earlier in the chapter. Use the Translate X channel of the bodyCtrl curve to drive the Translate X and Translate Y channels of one of the legs. Use the Pre- and Post-Infinity options to cycle the leg animation. Copy the animation to the other legs, and then use the Graph Editor to offset the animation for each leg.

Animate with expressions

Expressions are a powerful way to automate the movement of an object. Using conditional statements you can create an expression that causes the animation to react to changes in the scene automatically.

Master it

Create an expression to randomly rotate the bug's eyes up and down. Make the rotation faster based on the height of the bodyCtrl curve.

Solution

Create an expression on the Translate Y channel of the eyeAimLoc locator in the mechanicalBug rig. The expression should read as follows:

eyeAimLoc.translateY = (bodyCtrl.translateY*noise(time));
Animate with motion paths

Motion paths allow you to attach an object to a curve. Over the course of the animation the object slides along the curve based on the keyframes set on the motion path's U Value.

Master it

Make the bug walk along a motion path. See if you can automate a walk cycle based on the position along the path.

Solution

Draw a curve in a scene with the fully rigged mechanical bug. Attach the bodyCtrl curve to the curve using Animate

Chapter 5: Animation
Use animation layers

Animation layers are a new feature in Maya 2009. Using animation layers you can add new motion that can override existing animation or be combined with it.

Master it

Create animation layers for the flying bug in the mechBug_v08.ma scene in the chapter5scenes directory on the DVD. Create two layers: one for the bodyCtrl curve and one for the legsCtrl curve. Use layers to make the animation of the wings start with small movements and then flap at full strength.

Solution

Open the mechBug_v08.ma scene. Select the bodyCtrl curve. In the animation layers create an empty layer. Select the BaseAnimation layer, select the bodyCtrl curve, and choose Layers

Chapter 5: Animation

Chapter 6: Animating with Deformers

Animate facial expressions

Animated facial expressions are a big part of character animation. It's common practice to use a Blend Shape deformer to create expressions from a large number of Blend Shape targets. The changes created in the targets can be mixed and matched by the deformer to create the expressions and speech for a character.

Master it

Create Blend Shape targets for the nancy character. Make an expression where the brows are up and the brows are down. Create a rig that animates each brow independently.

Solution

Create two duplicates of the neutral nancy character. Use the modeling tools to model raised eyebrows on one copy and lowered eyebrows on the other. Add these targets to the nancy model. Use the Paint Blend Shape tool to make four additional targets: leftBrowUp, leftBrowDown, rightBrowUp, and rightBrowDown. Add these new targets to the nancy model. Create a custom slider using the Curve tool. Connect the slider to the Blend Shape controls using driven keys.

Create Blend Shape sequences

Blend Shapes can be applied in a sequential order to animate a sequence of changes over time.

Master it

Create a Blend Shape sequence of a mushroom growing.

Solution

Create a model of a mushroom. Create a duplicate of the model, and edit each duplicate to represent stages in the growth of the mushroom. Work backwards from the formed mushroom to the very beginning. Select the mushroom stage models in order of their growth stages, and apply them to the first stage of the mushroom group as a Blend Shape. Check the In-between setting in the Blend Shape Options.

Use lattices

Lattices are freeform deformers that create a 3D cage around an object. The differences between the lattice and the lattice base are used to deform geometry.

Master it

Animate a cube of jelly squishing along a path.

Solution

Create a polygon cube with a lot of divisions. Apply a lattice deformer to the cube. Scale the lattice and the base node together so they encompass the path of the cube. Use the Move tool to select and move the lattice points. Animate the cube moving through the lattice.

Animate clusters

Clusters are simple deformers that are most often used to animate the vertices of geometry.

Master it

Create an animated garden hose using clusters.

Solution

Create a NURBS curve. Create cluster deformers for each CV of the curve. Extrude a NURBS circle along the curve path. Keyframe the translation of the clusters as you move them in the scene.

Animate nonlinear deformers

Nonlinear deformers apply simple changes to geometry. The deformers are controlled by animating the attributes of the deformer.

Master it

Animate an eel swimming past the jellyfish we created in this chapter.

Solution

Model a simple eel using your favorite tools and techniques. Apply a sine deformer to the eel. Create an expression that animates the offset of the sine wave. Group the eel and the deformer, and animate the group moving past the jellyfish.

Use jiggle deformers

Jiggle deformers add a simple jiggling motion to animated objects.

Master it

Add a jiggling motion to the belly of a character.

Solution

Create a rotund character. Animate the character moving. Add a jiggle deformer to the character. Use the Paint Jiggle Weights tool to mask the jiggle weights on the entire character except for the belly.

Use the geometry cache

Geometry caches store the animation information of each vertex of a piece of geometry. The Cache controls can be used to speed up or slow down the animation of a cached object.

Master It

Create a slow-motion effect for an animation that uses a deformer.

Solution

Animate an object using deformers. Create a geometry cache. In the attributes for the geometry cache, increase the scale. Try animating the Scale attribute using keyframes.

Chapter 7: Rigging and Muscle Systems

Understand rigging

A rig is a system of controls and deformers used to make the process of animating easier. Joints are the most common deformers used to create a character animation rig. Joints are bound directly to geometry or indirectly by skinning another deformer, such as a lattice, to the joints.

Master it

Create a rig using three bones and a lattice around a simple piece of geometry such as a sphere. Use the bones to animate the lattice.

Solution

Create a polygon sphere and apply a lattice deformer to the sphere. Create three joints at the center of the lattice running along its vertical axis. Select the joints and the lattice, and use Smooth Binding to bind the lattice to the joints. Move the joints, and the lattice should update.

Create and organize joint hierarchies

A joint hierarchy is a series of joint chains. Each joint in a chain is parented to another joint, back to the root of the chain. Each joint inherits the motion of its parent joint. Organizing the joint chains is accomplished through naming and labeling the joints. Proper orientation of the joints is essential for the joints to work properly.

Master it

Create a joint hierarchy for a humanoid character. Label the joints and create names based on the labels. Orient the joints so the X axis points down the length of the joints.

Solution

Create a joint chain with the root of the chain at the character's pelvis. Create a leg and an arm on one side of the body. Use the Label feature to create labels for these joints; then use the Create Names From Labels feature to automatically name the joints after the labels. Orient the joints, and then mirror the legs and arms from one side to the other.

Use Inverse Kinematics rigs

A joint chain that uses Inverse Kinematics uses a goal called an End Effector to orient the joints in the chain. There are a number of solvers available in Maya, some of which need to be loaded into Maya using the command line.

Master it

Create an Inverse Kinematic rig for a character's leg. Use a separate control to position the knee of the character.

Solution

Create an Inverse Kinematic Handle for a simple leg using the RP Solver. Create a locator and place it in front of the knee. Apply a Pole Vector constraint to the leg's IK Handle using the locator as a handle.

Apply skin geometry

Skinning geometry refers to the process in which geometry is bound to joints so that it deforms as the joints are moved and rotated. Each vertex of the geometry receives a certain amount of influence from the joints in the hierarchy. This can be controlled by painting the weights of the geometry on the skin.

Master it

Paint weights on the hand model so that the padding of the thumb bulges when the thumb is rotated toward the palm of the hand.

Solution

Bind the joints created in the left arm example files to the arm geometry. Use the Paint Weights tool to paint the weights for each joint on the arm. Rotate the thumb joints so that the thumb points toward the palm of the hand. Carefully paint the weights on the inside of the hand so that they are distributed between the hand joints and the thumb joints.

Use Maya Muscle

Maya Muscle is a series of tools designed to create more believable deformations and movement for objects skinned to joints. Capsules are used to replace Maya joints. Bones are deformers created from geometry, and muscles are NURBS surfaces that squash, stretch, and jiggle as they deform geometry.

Master it

Use Maya Muscle to create muscles for the forearm. Use the muscle system to reduce the amount of shrinking that occurs in the arm geometry when the forearm is rotated around its axis.

Solution

Use the Muscle Builder to make a surface that is attached to the wrist and elbow. Convert the surface into a muscle, and use the Squash and Stretch presets to deform the muscle so that it reduces the shrinking that occurs when the upper part of the forearm is twisted.

Chapter 8: Paint Effects and Toon Shading

Use the Paint Effects canvas

The Paint Effects canvas can be used to test Paint Effects strokes or as a 2D paint program for creating images.

Master it

Create a tiling texture map using the Paint Effects canvas.

Solution

Choose a brush from the Visor, such as the downRedFeathers.mel brush from the feathers folder. On the canvas toolbar, enable the Horizontal and Vertical Wrap options. Paint feathers across the canvas; strokes that go off the top or sides will wrap around to the opposite side. Save the image in the Maya IFF format, and try applying it to an object in a 3D scene.

Paint on 3D objects

Paint Effects brushes can be used to paint directly on 3D objects as long as the objects are either NURBS or polygon geometry. Paint Effects brushes require that all polygon geometry have mapped UV texture coordinates.

Master it

Create a small garden or jungle using Paint Effects brushes.

Solution

Model a simple landscape using a polygon or NURBS plane. Create some small hills and valleys in the surface. Make the object paintable, and then experiment using the Brush presets available in the Visor. The plants, plantsMesh, trees, treesMesh, flowers, and flowersMesh folders all have presets that work well in a garden or jungle setting.

Understand strokes

A Paint Effects stroke has a number of associated nodes that are created and connected when the stroke is painted in the scene. These include the stroke's transform node, shape node, brush node, and curve node. Most of the time you'll edit settings on the stroke's shape node and brush node. You can use brush sharing to connect all of the strokes in the scene to the settings on a single brush node.

Master it

Use the Leafy Vine stroke to add a series of vine strokes to a simple wall model. Change the Global Scale setting of all the strokes at the same time.

Solution

Create a wall model from a polygon cube. Make sure the wall model has UV texture coordinates properly applied. Make the wall paintable, and select the Leafy Vine stroke from the Plants folder of the Visor. Paint strokes directly on the wall to create a series of vines. Select all of the vine strokes, and choose Paint Effects

Chapter 8: Paint Effects and Toon Shading
Design a brush

Custom Paint Effects brushes can be created by using a preset brush as a starting place. You can alter the settings on the brush node to produce the desired look for the brush.

Master it

Design a brush to look like a laser beam.

Solution

Use one of the neonGlow brushes found in the glows folder in the Visor. Paint the brush in a 3D scene, paint as straight a line as possible, or attach the stroke to a straight curve using the options in the Paint Effects

Chapter 8: Paint Effects and Toon Shading
Create tubes

Tubes are short strokes that grow outward from the main path of the stroke. They can assume a variety of shapes and sizes to create any number of objects.

Master it

Create a paintbrush that resembles the strokes used in Vincent Van Gogh's painting "Starry Night."

Solution

Choose the Blue Oil brush from the oils folder of the Visor. Paint a stroke in a scene. Increase the Brush Width, and activate Tubes. Increase the Tubes Per Step, and then see if you can fine-tune the brush to look like an Impressionist stroke. Use the Hue Rand, Sat Rand, Val Rand, and other Randomization options in the Shading and Tube Shading sections of the Brush attributes.

Add growth

Branches, twigs, leaves, flowers, and buds can be added to Paint Effects tubes. You can use these to simulate plants or apply them creatively to design unique shapes.

Master it

Create a mushroom tree using the Cortinarius Mushroom stroke found in the plantsMesh folder of the Visor.

Solution

Use the Cortinarius brush to paint some mushrooms in the scene. In the Growth section of the Brush attributes, activate Branches. Increase the Length Min and Length Max sliders in the Creation section of the Brush attributes to extend the height of the tree and the length of the branches. Adjust the settings in the Flowers section of the attributes to change the shape of the mushroom cap.

Shape strokes with behaviors

Behaviors are settings that can be used to shape strokes and tubes, giving them wiggling, curling, and spiraling qualities. You can animate behaviors to bring strokes to life.

Master it

Add tendrils to a squashed sphere to create a simple jellyfish.

Solution

Use the slimeWeed brush in the grasses folder of the Visor. Paint on the bottom of the sphere. Adjust the look of the tendrils by modifying the Noise, Curl, Wiggle, and Gravity forces in the Behavior section of the Brush attributes.

Animate growth

Paint Effects strokes can be animated by applying keyframes, expressions, or animated textures directly to stroke attributes. You can animate the growth of strokes by using the Time Clip settings in the Flow Animation section of the Brush attributes.

Master it

Animate blood vessels growing across a surface. Animate the movement of blood within the vessels.

Solution

Use any of the Branching Tree presets as a starting point for the blood vessels. Use the Shading attributes to add a red color. Animate the growth of the vessels by activating Time Clip in the Flow Animation attributes. To animate the blood in the vessels, set the Texture type to Fractal for the color in the Texturing section and activate Texture Flow in the Flow Animation attributes.

Render Paint Effects strokes

Paint Effects strokes are rendered as a post process using Maya software. To render with mental ray, you should convert the strokes to geometry.

Master it

Render an animated Paint Effects tree in mental ray.

Solution

Choose the Tree Sparse stroke from the Trees folder of the Visor. Draw the tree in the scene, and add animation using the Turbulence controls (choose Tree Wind turbulence). Convert the tree to polygons and render with mental ray.

Use Toon Shading

Toon Shading uses Paint Effects to create lines around the contours of an object and a ramp shader to color the surface of the object to replicate the look of a hand-drawn cartoon.

Master it

Add glowing contour lines to a futuristic vehicle to imitate the look of a vector-style rendering in a computer display.

Solution

Add Paint Effects outlines to a vehicle. Select one of the neon brush strokes from the Glows folder of the Visor, and apply it to the toon lines (Toon

Chapter 8: Paint Effects and Toon Shading

Chapter 9: mental ray Lights

Use shadow-casting lights

Lights can cast either depth map or ray trace shadows. Depth map shadows are created from an image projected from the shadow-casting light, which reads the depth information of the scene. Ray trace shadows are calculated by tracing rays from the light source to the rendering camera.

Master it

Compare mental ray depth map shadows to ray trace shadows. Render the crystalGlobe.ma scene using soft ray trace shadows.

Solution

Depth map shadows render faster and are softer than ray trace shadows. Ray trace shadows are more physically accurate. Create a light and aim it at the crystalGlobe. Enable Ray Trace Shadows and increase the Shadow Rays and the Light Radius settings.

Render with Global Illumination

Global Illumination simulates indirect lighting by emitting photons into a scene. Global Illumination photons react with surfaces that have diffuse shaders. Caustics use photons that react to surfaces with reflective shaders. Global Illumination works particularly well in indoor lighting situations.

Master it

Render the rotunda_v01.ma scene using Global Illumination.

Solution

Create a photon-emitting area light, and place it near the opening in the top of the structure. Set its Intensity to 0. Create a shadow-casting direct light, and place it outside the opening in the ceiling. Turn on Emit Photons for the area light, and enable Global Illumination in the Render Settings window. Increase Photon Intensity and the number of photons emitted as needed.

Render with Final Gathering

Final Gathering is another method for creating indirect lighting. Final Gather points are shot into the scene from the rendering camera. Final Gathering includes color bleeding and ambient occlusion shadowing as part of the indirect lighting. Final Gathering can be used on its own or in combination with Global Illumination.

Master it

Create a fluorescent light bulb from geometry that can light a room.

Solution

Model a fluorescent light bulb from a polygon cylinder. Position it above objects in a scene. Apply a Lambert shader to the bulb, and set the incandescent channel to white. Enable Final Gathering in the Render Settings window, increase the Scale value, and render the scene. Adjust the settings to increase the quality of the render.

Use Image-Based Lighting

Image-Based Lighting (IBL) uses an image to create lighting in a scene. High Dynamic Range Images (HDRI) are usually the most effective source for IBL. There are three ways to render with IBL: Final Gathering, Global Illumination, and with the light shader. These can also be combined if needed.

Master it

Render the car scene using the Uffizi Gallery probe HDR image available at www.debevec.org/Probes/.

Solution

Create an Image-Based Lighting node in the car scene using the settings in the Render Settings window. Download the Uffizi Gallery light probe image from www.debevec.org/Probes/. Apply the image to the IBL node in the scene (use Angular mapping). Experiment using Final Gathering, Global Illumination, and the IBL light shader. Use these in combination to create a high-quality render.

Render using physical sun and sky

The Physical Sun and Sky network creates realistic sunlight that's ideal for outdoor rendering.

Master it

Render a short animation showing the car at different times of day.

Solution

Add the Physical Sun and Sky network to the car scene using the settings in the Render Settings window. Make sure Final Gathering is enabled. Keyframe the sunDirection light rotating on its X axis over 100 frames. Render a sequence of the animation.

Understand mental ray area lights

mental ray area lights are activated in the mental ray section of an area light's shape node when the Use Light Shape option is enabled. mental ray area lights render realistic, soft ray trace shadows. The light created from mental ray area lights is emitted from a three-dimensional array of lights as opposed to an infinitely small point in space.

Master it

Build a lamp model that realistically lights a scene using an area light.

Solution

Build a small lamp with a round bulb. Create an area light, and place it at the center of the bulb. In the area light's shape node settings, enable Use Shape in the mental ray settings, and set the shape Type to Sphere. Scale down the light to fit within the bulb. Enable Ray Trace Shadows and render the scene.

Work with mental ray light shaders

mental ray has a number of shaders that can be applied to lights to extend their capabilities in a scene. One of these shaders is the Portal Light shader, which helps focus Final Gather points around light entering a room through an opening.

Master it

Render the rotunda_v01.ma scene using the Portal Light shader.

Solution

Open the rotunda_v01.ma scene and add a Physical Sun and Sky network using the settings in the Render Settings window. Create a mental ray area light, and place it near the opening in the ceiling. Make sure the Visible option is enabled. Add the Portal Light shader to the Light Shader and the Photon Emitter slots in the area light's Custom Shader section. Enable Final Gather and render the scene. Use the settings on the portal shader node to adjust the look of the lighting.

Create Participating Media

Participating Media (PM) refers to particulate matter suspended in the air. Light is reflected from PM, creating the streaming beams of light known as volumetric lighting. Several shaders can be set up to create the look of PM in a mental ray render.

Master it

Render a beam of light coming from a flashlight model.

Solution

Model a simple flashlight. Parent a spotlight to the end of the flashlight. Create a polygon cube to surround the area around the flashlight, and attach the Transmat shader to the cube. In the Transmat shader's shading group node, attach a parti_volume shader to the Volume Material slot in the mental ray section. Enable Auto Volume in the Features section of the Render Settings. Attach a Physical Light shader to the spotlight, and render the scene. Adjust the settings on the parti_volume shader to improve the brightness and quality of the PM.

Chapter 10: mental ray Shaders

Use ambient occlusion

Ambient occlusion describes the dark shadowing that occurs when ambient light rays are prevented from reaching part of a surface by another nearby surface. You can use the mib_amb_occlusion node in mental ray to fake the look of indirect lighting or augment the ambient occlusion shadowing that occurs when rendering with Final Gathering.

Master it

Create an ambient occlusion shader from a standard Maya shader.

Solution

Create a surface shader, connect an mib_amb_occlusion node to the Out Color channel of the surface shader. Use the Sampling, Spread, and Max Distance settings to tune the quality of the effect.

Understand shading concepts

Light rays are reflected, absorbed by, or transmitted through a surface. A rough surface diffuses the reflection of light by bouncing light rays in nearly random directions. Specular reflections occur on smooth surfaces; the angle at which rays bounce off a smooth surface is equivalent to the angle at which they strike the surface. Refraction occurs when light rays are bent as they are transmitted through the surface. A specular highlight is the reflection of a light source on a surface. In CG rendering this effect is often controlled separately from reflection; in the real world specular reflection and highlights are intrinsically related.

Master it

Create a standard Maya shader that is more reflective on parts of the shader that face away from the camera.

Solution

Connect a black and white ramp texture to the Reflectivity of a standard Maya shader such as Blinn or Phong. Create a Sampler Info node and connect the facingRation of the smaplerInfoNode to the V coordinates of the ramp texture using the Connection Editor. Apply the shader to a surface and render using mental ray.

Apply reflection and refraction blur

Reflection and Refraction Blur are special mental ray options available on many standard Maya shading nodes. You can use these settings to create glossy reflections when rendering standard Maya shading nodes with mental ray.

Master it

Create the look of translucent plastic using a standard Maya Blinn shader.

Solution

Apply a Blinn shader to an object. Increase transparency and reflectivity. Enable Refractions in the Raytrace Options settings. In the mental ray section, increase the Mi Reflection and Mi Refractions settings. Render with mental ray.

Use basic mental ray shaders

The DGS and Dielectric shaders offer numerous options for creating realistic reflections and transparency. The mib (mental images base) shader library has a number of shaders that can be combined to create realistic materials.

Master it

Create a realistic CD surface using the mib shaders.

Solution

Attach a mib_illum_ward_deriv shader to the base shader slot of the mib_glossy_reflection node. Apply this material to the top of a disc. Use the settings on the mib_illum_ward_deriv shader to create anisotropic specular highlights.

Apply the car paint shader

Car paint consists of several layers, which creates the special quality seen in the reflections on car paint. The mi_carpaint_phen shader can realistically simulate the interaction of light on the surface of a car model. The diffuse, reflection, and metallic flakes layers all work together to create a convincing render.

Master it

Design a shader for a new and an old car finish.

Solution

Apply the mi_carpaint_phen_x shader to a model, and add lighting to the scene (using a Physical Sun and Sky network is a fast way to create realistic lighting). For the new car, make sure that the reflections have a Glossy setting of 1, and increase the strength of the flakes. For the older car, lower the Glossy setting on the reflections and the strength of the flakes; add a dirt layer to the shader.

Use the MIA materials

The MIA materials and nodes can be used together to create realistic materials that are always physically accurate. The MIA materials come with a number of presets that can be used as a starting point for your own materials.

Master it

Create a realistic polished-wood material.

Solution

Create a mia_material_x shader for an object in a scene that uses physical sky and sun lighting. Use the Glossy finish as a starting place to create the material. In the Color channel of the Diffuse settings, add the Wood 3D texture from the standard Maya 3D texture nodes. Add glossiness to the reflections and the highlight (remember that lower settings spread out the reflection, whereas higher settings create a more defined reflection).

Control exposure using tone mapping

Tone mapping corrects images that appear improperly exposed when rendering. This frequently occurs when HDRI lighting is used, when physical lights are used, and especially when physical lights are combined with MIA materials.

Master it

Create a scene that uses physical light shaders on the lights. Apply MIA materials to the objects in the scene, and correct the exposure using tone mapping.

Solution

Add an mia_exposure_simple lens shader to the rendering cameras in the scene. Adjust the settings on the lens shader to correct for exposure problems.

Render contours

mental ray has the ability to render contours of your models to create a cartoon drawing look for your animations. Rendering contours requires that options in the Render Settings window and on the shading group for the object are activated.

Master it

Render the space suit helmet using contours.

Solution

Open one of the versions of the helmet scene in the chapter10scenes directory. Apply a material to the helmet geometry. Enable Contour Rendering in the material's shading group node and in the Features tab of the Render Settings window.

Chapter 11: Texture Mapping

Create UV texture coordinates

UV texture coordinates are a crucial element of any polygon or subdivision surface model. If a model has well-organized UVs, painting texture and displacement maps is easy and error free.

Master it

Map UV texture coordinates for a character's hand; then try a complete figure.

Solution

Start by using the UV map projection utilities to project coordinates onto the surfaces of the model. Then use the tools in the UV Texture Editor to stitch the coordinates together to create as few shells as possible. Apply a checker texture to the model so that you can spot areas where the texture is warped.

Create bump and normal maps

Bump and normal maps are two ways to add detail to a model. Bump maps are great for fine detail, such as pores; normal maps allow you to transfer detail from a high-resolution mesh to a low-resolution version of the same model as well as offer superior shading and faster rendering than bump maps.

Master it

Paint a bump map for a character. Create high-resolution and low-resolution versions of the model, and try creating a normal map using the Transfer Maps tool. See if you can bake the bump map into the normal map.

Solution

To include a bump map in the normal map calculation, first apply the bump texture to the object's material and then activate the Include Materials option in the settings of the Transfer Maps tool.

Create displacement maps

A displacement map is a grayscale texture that can actually alter the geometry of a model. There are a wide variety of uses for displacement maps.

Master it

Create some terrain using a procedural texture, such as the crater texture, as a displacement map for a plane. Try animating the depth of the map so that canyons form in the ground over time.

Solution

Start the animation with the Alpha Offset of the crater texture set to 1. Keyframe the Alpha Offset value over time so that after 60 frames or so, the Alpha Offset is at −2. Keep the Alpha Gain value at 1 throughout the animation.

Use the PSD network node

A PSD network automatically creates a multilayer Photoshop file with a layer group for each designated channel of a shader.

Master it

Create a PSD network for a shader that includes layers for transparency, incandescence, and reflected color.

Solution

When you create the network, use the PSD Network dialog box to select Transparency, Incandescence, and Reflected Color from the left side of the dialog and move them to the right.

Create a misss_fast_skin shader

The misss_fast_skin shader can create extremely realistic-looking skin. The secret is using painted texture maps for the Subsurface and Specularity channels.

Master it

Change the look of the old man character by making his skin paler or tanner; see if you can get the backlight to make his ears glow from behind.

Solution

Increase the weighting for the back-scattering challenge, and reposition the back light so that it shines from directly behind the character. Adjust the weights on the other channels, and try changing the Color Gain and Color Offset sliders on each of the textures used in the network.

Create texture maps for NURBS surfaces

NURBS models have UV texture coordinates built into the parameterization of the surface. You can convert a ramp into a texture to use as a guide for painting texture maps in Photoshop.

Master it

Create a texture for a tire that includes the text for the tire brand on the side of the tire.

Solution

Create a ramp texture for the tire, and use the ramp's color as a guide so you can see where the tread should go as well as which parts of the texture correspond to the sides of the tire. Convert the ramp into a file texture. In Photoshop, import the file texture, and create a tread pattern for the length of the center of the tire. Create text for the tire brand, and rotate it 90 degrees vertically. Use the texture as a displacement map for the tire.

Chapter 12: Rendering for Compositing

Use render layers

Render layers can be used to separate the elements of a single scene into different versions or into different layers of a composite. Each layer can have its own shaders, lights, and settings. Using overrides you can change the way each layer renders.

Master it

Use render layers to set up alternate versions of the space helmet. Try applying contour rendering on one layer and Final Gathering on another.

Solution

Open the helmetComposite_v01.ma scene from the chapter12scenes directory on the DVD. Add a second render layer by copying the helmet layer. In the render settings for the helmet layer, create a Layer Override for the Enable Contours setting, and turn this on (remember to activate one of the Draw By Property Difference options). Create a Layer Override for the Final Gathering option in the Indirect Illumination tab, and turn Final Gathering off. Apply a Lambert texture to all the helmet surfaces while in the helmet layer, and activate Contours in the Lambert's shading group node attributes. The helmet2 layer should still have Final Gathering activated. Test render both layers, and see if contours render correctly on the helmet layer and if Final Gathering renders on the helmet2 layer.

Use render passes

Render passes allow you to separate material properties into different images. These passes are derived from calculations stored in the Frame Buffer. Each pass can be used in compositing software to efficiently rebuild the rendered scene. Render Pass Contribution Maps define which objects and lights are included in a render pass.

Master it

Create an Ambient Occlusion pass for the minigun scene.

Solution

Open the minGunComposite_v01.ma scene. In the Passes tab of the Render Settings window, create an Ambient Occlusion pass. Move the AO (Ambient Occlusion) pass from the Scene Passes section to the Associated Passes section. In the Features tab, enable Ambient Occlusion. In the Indirect Lighting tab, set Ambient Occlusion Rays to 64. Render a test from the renderCam camera in the Render View window. Use the File menu in the Render View window to load the Ambient Occlusion pass (if the Load Render Pass option is not available, use the File menu to browse to the images directory of the current project; you'll find the pass in a folder called miniGun/AO).

Perform batch renders

Batch renders automate the process of rendering a sequence of images. You can use Maya's Batch Render options in the Maya interface or choose Batch Render from the command prompt (or Terminal) when Maya is closed. A batch script can be used to render multiple scenes.

Master it

Create a batch script to render five fictional scenes. Each scene uses layers with different render settings. Set the frame range for each scene to render frames 20 through 50. Each scene is named myScene1.ma through myScene5.ma.

Solution

Create a text file in plain-text format. Each line should be a command-line render script that looks like this:

Render -r file -s 20 -e 50 myScene1.ma

Save the text file as batchRender.bat (or .batch on a Mac) in the same directory as the scenes. On a Windows machine, you can double-click the .bat file. On a Mac, you need to use the Terminal to change the mode of the file into an executable (chmod 777). On the Mac, type ./batchRender.batch to start the render.

Use mental ray quality settings

The settings in the Quality tab of the Render Settings window allow you to adjust the anti-aliasing quality and the raytrace acceleration of a scene (among other things). Sampling improves the quality of the image by reducing flickering problems. Raytrace acceleration does not affect image quality but improves render times when raytracing is activated in a scene.

Master it

Diagnose both the sampling and the BSP depth of the helmetComposite_v04.ma scene.

Solution

Open the helmetComposite_v04.ma scene on the chapter12scenes directory on the DVD. In the Render Settings window, activate Diagnose Samples and perform a test render (turn off Final Gathering). The areas of light gray and white indicate the areas where most of the sampling occurs. Turn off Diagnose Sampling, and in the Acceleration options, set the Diagnose Bsp option to Depth. Set the sampling of the scene to −3 and perform a test render. The orange and red portions of the test render indicate areas where BSP voxels are approaching or have reached maximum depth.

Chapter 13: Introducing nParticles

Create nParticles

nParticles can be added to a scene in a number of ways. They can be drawn using the tool or spawned from an emitter, or they can fill an object.

Master it

Create a spiral shape using nParticles.

Solution

Create a polygon helix and fill it with nParticles. Make the surface transparent, and set Gravity to 0 in the Nucleus solver.

Make nParticles collide

NParticles can collide with themselves, other nParticles, and polygon surfaces.

Master it

Make nParticles pop out of the top of an animated volume.

Solution

Create a polygon cube and remove the top. Animate the cube shrinking along the X or Z axis. Fill the cube with nParticles (make the nParticle style balls or water with an Incompressibility value of 1), and make the cube a collision surface.

Create liquid simulations

Enabling Liquid Simulations changes the behavior of nParticles so they act like water or other fluids.

Master it

Create a flowing stream of nParticles that ends in a waterfall.

Solution

Model a trough in a polygon plane that slopes downward and ends at a cliff. Create a volume emitter set to the water nParticle style. Set Incompressibility to 0.5.

Emit nParticles from a texture

The emission rate of an nParticle can be controlled using a texture.

Master it

Create your own name in nParticles.

Solution

Use a digital paint program to create a texture using your name (black letters on a white surface work best). Import the texture into Maya using a file texture node. Create a surface emitter using a plane. Attach the file node to the Texture Emission Rate attribute of the emitter, and check Emit From Dark.

Move nParticles with nucleus wind

The wind force on the nucleus node can be used to push nParticles.

Master it

Create the effect of bubbles pushed back and forth under water.

Solution

Create an emitter using the ball-style nParticles. Set Gravity Direction to 1 in the Y axis field so the nParticles are pulled upward. Set the Air Density above 20. Create an expression that randomizes the wind speed using the noise function, such as nucleus1.windSpeed=2*(noise(time));, and set the Wind Noise attribute to 5.

Use the Hardware Render Buffer

The Hardware Render Buffer is a quick way to render nParticles using your machine's graphics card. It works well for creating flame effects.

Master it

Render a small fire using the Hardware Render Buffer.

Solution

To create the soft look of the frames, use the Multi Pass Render options in the Hardware Render Buffer Attributes section. Enable Multi Pass Rendering, and set Render Passes to a high value such as 20.

Use force fields

Force fields can be emitted by nParticles and collision objects, creating interesting types of behavior in your scenes.

Master it

Add a second nParticle object emitted from the base of the generator. Enable its force field so that it attracts some of the original energy nParticle.

Solution

Create a surface emitter from the base object in the generator. In the options, set Min Distance to 1 and Max Distance to 1.5; this ensures that the new particle is not trapped by the base surface (it is a collision object). Set Emission Rate to 10, and lower the Emission Rates on the other emitters so the scene plays back at a reasonable rate. Set the Point Force field to World Space. Set Magnitude to 10.

Render nParticles with mental ray

mental ray can be used to render all nParticle styles using raytraced features such as reflections and refractions.

Master it

Create and render a snowglobe effect.

Solution

Create a sphere and fill it halfway with point-style nParticles. Make the sphere a collision surface. Paint a texture map so that the base of the sphere has a high Stickiness value. Add a Wind setting to the Nucleus tab with an Air Density of 25. Add a Vortex field and a Turbulence field to the nParticle snow. Create reflective and refractive shaders for the sphere (or use the mia shader with the thick glass preset), and render using mental ray.

Chapter 14: Advanced nDynamic Effects

Use nCloth

nCloth can be used to make polygon geometry behave dynamically to simulate a wide variety of materials. Using the presets that come with Maya, you can design your own materials and create your own presets for use in your animations.

Master it

Create the effect of a cube of gelatinous material rolling down the stairs.

Solution

Model a cube and some stairs. Position the cube above the stairs and convert it into an nCloth object. Apply the Putty preset and try blending Water Balloon, Solid Rubber, and other presets until you get a nice gelatinous motion. Try raising the stickiness on the material to counteract some of the bounciness.

Combine nCloth and nParticles

Because nCloth and nParticles use the same dynamic systems, they can be easily combined to create amazing simulations.

Master it

Make a water balloon burst as it hits the ground.

Solution

Create a polygon balloon and convert it to an nCloth object. Place it above a floor object. Apply the Water Balloon preset to the nCloth. Fill the nCloth balloon with water nParticles. Add a tearable constraint to the nCloth balloon. Play the animation and adjust the settings until you get the effect you want.

Use nCloth for rigid body simulations

nCloth can be used to simulate rigid dynamics as well as soft surfaces. The Concrete preset is usually the best place to start when creating an nCloth rigid body. nCloth objects have a large number of settings that can give you more control over their behavior than you would get using traditional rigid bodies.

Master it

Animate a wrecking ball destroying a wall of nCloth bricks.

Solution

Model a polygon ball and a simple polygon rope. Convert the ball and rope to nCloth objects. Apply the Concrete preset to the wrecking ball and the Chain Mail preset to the rope. Use the component nConstraint to attach the end of the rope to the vertices at the top of the wrecking ball. Create a wall of polygon bricks and convert them to nCloth objects; apply the Concrete preset to the bricks. Position the ball so it swings toward the bricks. Adjust the settings as needed to create a believable effect.

Use traditional Maya rigid body dynamics

Traditional rigid body dynamics are not quite as powerful as nCloth objects, but they do calculate much faster and work better for simulations involving a large number of interacting pieces.

Master it

Animate a series of dominoes falling over.

Solution

Create a large number of polygon cubes, and arrange them in a line on a floor that is a passive rigid body. Convert the cubes into active rigid bodies. Add a gravity field to all of the active bodies. Apply a small radial field to the first rigid body so it falls over and collides with the second rigid body, creating a chain reaction of toppling dominoes.

Instance geometry to nParticles

Modeled geometry can be instanced to nParticles to create a wide variety of effects.

Master it

Create the effect of a swarm of insects attacking a beach ball.

Solution

Model a single insect. Place the model at the origin of the grid, and freeze transformations on the model. Animate the insect's wings flapping at a high rate of speed. Add an nCloth sphere and an nParticle emitter to the scene. Instance the insect to the nParticles, and make the nCloth sphere a goal for the nParticles. To make the insects face the correct direction, set the aim direction in the nParticles' Instance attributes to Velocity.

Create nParticle expressions

nParticle expressions can be used to further extend the power of nParticles. Using expressions to automate instanced geometry simulations is just one of the ways in which expressions can be used.

Master it

Improve the animation of the insects attacking the beach ball by adding different types of insects to the swarm. Randomize their size, and create expressions so that larger insects move more slowly.

Solution

Model several types of insects; place them all at the origin. Add the new geometry to the instance node in the swarm scene. Make a creation expression to randomize the index number of the instances so more than one type of insect is included in the swarm. Use the Mass Scale ramp to randomize the mass of the insect nParticles. Create an expression that bases the scale in X, Y, and Z of each instance on the mass of each nParticle.

Create smoke effects

Using the cloud nParticle type, smoke can be added to a simulation. nCloth objects and nParticles can be turned into emitters to emit the smoke.

Master it

In the explosion scene from this chapter, make the nCloth bricks emit a smoke trail as they fly out from the tower.

Solution

Select the active bricks and convert them to surface emitters. Set the nParticle type to Cloud. Use the nParticle ramps to make the cloud nParticles grow and fade in opacity as they are emitted from the nCloth bricks. Make sure the nParticles have a defined life span.

Chapter 15: Fur, Hair, and Clothing

Add fur to characters

Maya Fur is a rendering module that adds realistic short hairs to the surface of characters to simulate fur. Fur can be rendered using both Maya Software and mental ray. The placement, length, and other attributes of fur can be controlled by painting on the surface with the Artisan tool interface. When adding fur to polygons, the success of the fur is largely dependent on how well the UV texture coordinates have been mapped.

Master it

Create furry whiskers for the old man model used in Chapter 11.

Solution

Open the UVMap_v06.ma scene from the chapter11scenes directory on the DVD. Attach fur to the model and paint a baldness map so that nonwhiskered areas are at a value of 0 and whiskered areas have a low value, such as 0.3, to create sparse whiskers.

Add dynamic motion to fur

Using hair curves as a control, fur can be made to react to dynamic forces.

Master it

Create a field of grass that blows in the wind.

Solution

Model some rolling hills and apply the Grass Fur preset to the hills. Make the length of the grass fairly long. Apply a grid of hair follicles to the field, and apply forces to the hair follicles (you may want to lower the gravity in the hairSystem node). Attach the hairSystem to the grass fur description.

Render fur with mental ray

Fur can be rendered using mental ray or Maya Software. The Rapid Fur mental ray Quality preset works well when rendering fur with depth map shadows. The Fine Trace mental ray Quality preset works well when rendering with mental ray and ray trace shadows and reflections.

Master it

Add a Physical Sun and Sky network to the hound dog scene, and render with mental ray.

Solution

Open the hound_v09.ma scene, open the Render Settings window, and set the renderer to mental ray. In the Indirect Lighting tab, click the Add Physical Sun And Sky button. Render using the perspective camera. Be prepared for a long render!

Create dynamic curves

A standard Maya curve can be made dynamic by using the Make Dynamic Curves action in the Hair menu. A copy of the curve is created that will respond to dynamic motion and forces. The curve can be used in skeletons for IK Spline tools, as a source for Paint Effects strokes, as a modeling tool, or for any other effect that requires curves.

Master it

Create a flag using dynamic curves.

Solution

Create two parallel curves and make both dynamic. Set the Point Lock attribute on both curves to Base. Loft a NURBS surface between the dynamic curves. Edit the dynamic properties of the curves, and apply fields to the curves to create a flapping motion for the flag.

Add hair to characters

Hair is created using Paint Effects strokes that are controlled by follicles. The follicles are dynamic curves that respond to forces and movement. Follicles can be applied to polygon or NURBS surfaces as a grid or by painting on the surface. The Visor contains a number of hair presets that can be imported into a scene.

Master it

Add hair to the old man character from Chapter 9.

Solution

Open the UVMap_v06.ma scene from the chapter11scenes folder on the DVD. Create a scalp surface for the old man by duplicating selected faces on the head. Paint follicles on the head to suggest hair growing from the sides and back of the head. Use Thinning and other hair properties to create the look of long and wispy hair.

Style hair

Hair can be styled by painting attribute values on follicles, by using dynamic fields, or by directly editing the CVs of start or rest curves.

Master it

Create an avant-garde hairdo for the nancy character using fields.

Solution

Open the nancyHair_v06.ma scene. Apply a turbulence field to the hairSystem1 node. Set Magnitude to a high value (10 to 20) and set Attenuation to 0. Play the animation. When the hair achieves an interesting state, select the follicles and set the state as the hair's rest position (and start position). Delete the field, and increase the hair's start curve Attract attribute.

Use hair constraints

Hair constraints can be used to control the motion of hair or to connect the hair to props, such as hair ties and scrunchies.

Master it

Use a constraint to create a ponytail for a character.

Solution

Create hair for a character. Select a number of the start curves and apply a hair-to-hair constraint. Play the simulation, and adjust the properties of the constraint to create a ponytail at the back of the head. The effect of the motion of the constraint is visible in the hair strokes.

Render hair

Hair can be rendered using mental ray or Maya. You can render as Paint Effects strokes or convert the strokes to geometry. Either method works in both Maya Software and mental ray (in spite of the fact that Paint Effects cannot normally render in mental ray).

Master it

Apply the Hair preset examples found in the Visor to a character, and render with mental ray.

Solution

Open the Visor and import one of the hair examples into a scene with a character. Transplant the hair from the imported surface to your character, or just parent the imported hair surface to your character's rig. Import the hairLights.ma file from the Visor, and render using the Fine Trace Quality preset in the mental ray settings.

Create clothing for characters

Clothing is created by converting polygon geometry to an nCloth object. The object can be attached to a character using constraints.

Master it

Create sweatpants and a sweatshirt with a hood for the simple man character.

Solution

Open the simpleMan_v01.ma scene from the chapter15scenes directory. Delete the existing shirt and pants objects. Model sweatpants and a hooded sweatshirt using polygon modeling techniques. Convert the pants and shirt to nCloth objects, and make the man's geometry a passive collider. Use a transform constraint to connect the vertices at the top of the sweatpants to the rootCtrl locator in the man's rig. Apply an nCloth preset, such as Heavy Knit, to the nCloth objects.

Paint nCloth properties

Properties such as Bounce, Stretch, and Wrinkle can be painted onto nCloth objects using either texture or vertex painting techniques. When painting properties, the Min and Max Value ranges in the Artisan interface may need to be altered to allow for values beyond the range of 0 to 1. Vertex maps have the advantage that the values are not stored in an external texture file.

Master it

Add starch to the simple man's shirt by painting a Rigidity value on the shirt geometry.

Solution

Open the simpleMan_v06.ma scene from the chapter15scenes directory. Select the surface and paint a vertex map. Choose Rigidity as the property you want to paint. Set Max Value in the Artisan Tool options to 30. Set the Max Color slider in the Artisan Display options to 30. Set the Paint value to somewhere between 20 and 30, and paint on the surface where you want the shirt to be stiff. Adjust the values as needed.

Chapter 16: Maya Fluids

Use fluid containers

Fluid containers are used to create self-contained fluid effects. Fluid simulations use a special type of particle that is generated in the small subunits (called voxels) of a fluid container. Fluid containers can be 2D or 3D. 2D containers take less time to calculate and can be used in many cases to generate realistic fluid effects.

Master it

Create a logo animation that dissolves like ink in water.

Solution

Create a 2D fluid container, and use the Paint Fluids tool to paint density values in the container. Paint a logo or import a black-and-white image file of the logo. Set the Buoyancy of the fluid to 0. Use dynamic fields to push the logo to create the dissolving motion. Try using turbulence, drag, and vortex fields on the logo.

Create a reaction

A reaction can be simulated in a 3D container by combining temperature with fuel. Surfaces can be used as emitters within a fluid container.

Master it

Create a chain reaction of explosions using the Paint Fluids tool.

Solution

Create a 3D fluid container. Use the Paint Fluids tool to paint small blobs of fuel separated by short distances. The painted fuel blobs should be arranged so that they create a chain reaction when lit. Add an emitter that emits temperature, and place it below the first fuel blob in the container. Set the Ignition Temperature, Reaction Speed, and Heat Released attributes in the Fuel section of the container so the fuel burns and emits heat when a certain temperature is reached. Set Shading to Temperature so that you can see the reaction.

Render fluid containers

Fluid containers can be rendered using Maya Software or mental ray. The fluids can react to lighting, cast shadows, and self-shadow.

Master it

Render the TurbulentFlame.ma example in the Visor so that it emits light onto nearby surfaces.

Solution

Create a scene that has simple modeled surfaces such as a floor and some logs. Import the TurbulentFlame.ma scene from the Fire folder of the Visor (under the Fluid Examples tab). Set the renderer to mental ray. In the Indirect Lighting section, turn on Final Gathering. Increase Final Gathering Scale to 4. Turn off Default Light in the Common Attributes tab of the Render Settings window. Play the animation, and render a test frame when the fire is burning.

Use fluids with nParticles

Fluid simulations can interact with nParticles to create a large array of interesting effects.

Master it

nCloth objects use nParticles and springs to simulate the behavior of cloth. If fluids can affect nParticles, it stands to reason that they can also affect nCloth objects. Test this by creating a simulation where a fluid emitter pushes around an nCloth object.

Solution

Create a 3D fluid container and an emitter that emits density and temperature. The fluid should rise in the container, and the Swirl attribute in Velocity should be set to 10 so that there is a turbulent motion. Create a polygon sphere and place it inside the fluid container above the emitter. Convert the sphere to an nCloth object. Use the Silk preset for the nCloth object, and set Gravity in the Nucleus tab to 0.1. Play the animation, and experiment with the settings in the fluid container and on the nCloth object until the fluid pushes the nCloth object around.

Create a pond

A pond uses a 2D fluid container and the Spring Mesh solver to create a pond surface. You can float objects in the pond and use wake emitters to create ripples. The pond can be converted to a polygon mesh to allow for more advanced shading techniques.

Master it

Open the swamp.ma scene in the chapter16scenes directory, and create a pond. Add ripples to the surface.

Solution

Open the swamp_v01.ma scene from the chapter16scenes directory. The scene has a small ditch and a few Paint Effects trees that have been converted to polygons. Create a pond surface. Add some wake emitters around the edges of the pond to create ripples. These can be hidden behind geometry in the scene. Convert the pond into polygons, and create a surface that looks like dark, brackish water.

Create an ocean

Ocean effects are created and edited using the Ocean shader. Objects can float in the ocean using locators.

Master it

Create an ocean effect that resembles stormy seas. Add the capsule geometry as a floating object.

Solution

Import the WhiteCaps.ma scene from the Ocean Examples tab of the Visor. Import the capsule_v01.ma scene from the chapter16scenes directory on the DVD. Use the Float Selected Objects command to make the capsule float on the surface of the water. Look at the settings in the ocean shader node to see how the stormy sea effect was created.

Chapter 17: MEL and Python

Use a MEL command

MEL commands are used to perform many tasks within Maya. There are numerous ways to enter MEL commands in the Maya interface. These include the command shell, the command line, and the Script Editor.

Master it

Create a polygon cube using the command shell. Create a NURBS cone using the command line. Create a polygonSphere using the Script Editor.

Solution

Open the command shell and type polyCube. In the command line, type cone. In the work area of the Script Editor, type polySphere.

Use MEL scripting techniques

Many basic MEL techniques can be used to reduce the number of repetitive tasks performed during a Maya session. Using commands, conditional statements, and loops, you can make simple scripts that make working in Maya faster and more efficient.

Master it

Write a more efficient version of the mySpriteScript file that automatically selects all of the nParticle objects in a scene without the need for a conditional statement to test the type of the selected nodes.

Solution

In the Script Editor choose History

Chapter 17: MEL and Python
Create a procedure

Procedures are sections of code that can be called upon at any time within a script. Procedures can help make longer scripts more efficient by eliminating the need to repeat sections of code.

Master it

Write a procedure that adds an expression to selected objects that use the noise function to randomly scale objects over time.

Solution

Edit the shakeMeProc.mel file. Replace the text translateX=rand(−1,1); with scaleX=noise(time);. Repeat this for TranslateY and TranslateZ.

Use Python

Python can be used within the Script Editor to execute Python commands or to execute MEL commands within a Python script. The Maya commands must be imported at the start of Python script if you want to incorporate MEL into the Python code.

Master it

Use Python to make a NURBS torus.

Solution

Switch the Script Editor tab to Python mode. Import MEL commands by typing maya.cmds. Type maya.cmds.torus() to create the torus using default settings. Flags can be used to specify attributes of the torus. Look up Python commands in the Technical Documentation section of the Maya help files for more information.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset