Editing the Fur Description: Direction
You can use the Artisan Brush interface to comb the fur by painting the Direction attribute.
1. Continue with the scene from the previous section, or open the hound_v03.ma scene from
the chapter15\scenes directory on the DVD.
You’ll notice that there is no Direction or Comb attribute listed in the attributes for
the houndFur node. Painting the Direction attribute is the same as painting the Polar
attribute.
2. In the houndFur node’s Attribute Editor, set Inclination to 1, and move the Polar slider
back and forth. The Polar slider determines the direction in which the fur strands face,
but you’ll notice that the direction is not uniform across the surface.
Inclinationâã‡â㉠âã‡â㉠Sets the angle at which the hair stands from the surface. A value of 0 is perpendicular
to the surface; a value of 1 causes the fur to lie flat against the surface. If the
value is 0, then the fur strand sticks straight up, so changing its direction has no visible
effect.
Rollâã‡â㉠âã‡â㉠Rotates the fur around its root. A value of 0 is -90 degrees; a value of 1 is 90 degrees.
Base Curl and Tip Curlâã‡â㉠âã‡â㉠Determine the amount of curling applied to the base and tip
of the hair. A value of 0.5 produces straight hair; a value of 0 or 1 curls the hair from one
side or the other
105 trang |
Chia sẻ: tlsuongmuoi | Lượt xem: 2483 | Lượt tải: 0
Bạn đang xem trước 20 trang tài liệu Adding Fur to Characters, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
addIng Fur to CharaCters | 811
I prefer doing much of my texture map painting in Pixologic’s ZBrush because of its intuitive poly-
gon painting workflow. I like to use ZBrush to carefully paint the baldness and other fur attribute
maps, especially when doing something such as creating whiskers for a character’s face. You can
just as easily use Mudbox to paint these maps as well.
Editing the Fur Description: Direction
You can use the Artisan Brush interface to comb the fur by painting the Direction attribute.
1. Continue with the scene from the previous section, or open the hound_v03.ma scene from
the chapter15\scenes directory on the DVD.
You’ll notice that there is no Direction or Comb attribute listed in the attributes for
the houndFur node. Painting the Direction attribute is the same as painting the Polar
attribute.
2. In the houndFur node’s Attribute Editor, set Inclination to 1, and move the Polar slider
back and forth. The Polar slider determines the direction in which the fur strands face,
but you’ll notice that the direction is not uniform across the surface.
Inclination Sets the angle at which the hair stands from the surface. A value of 0 is per-
pendicular to the surface; a value of 1 causes the fur to lie flat against the surface. If the
value is 0, then the fur strand sticks straight up, so changing its direction has no visible
effect.
Roll Rotates the fur around its root. A value of 0 is -90 degrees; a value of 1 is 90 degrees.
Base Curl and Tip Curl Determine the amount of curling applied to the base and tip
of the hair. A value of 0.5 produces straight hair; a value of 0 or 1 curls the hair from one
side or the other.
812 | Chapter 15 Fur, haIr, and ClothIng
The change in direction created by the Polar attribute is based on the direction of the UV
texture coordinates. This means that a value applied to fur on one part of the model has
a different result than a value applied on another part of the model. To comb the hair
correctly, you use the Direction attribute in the Paint Fur Attributes tool to apply a Polar
value based on the direction that you drag across the surface. So when you choose to
paint the Direction attribute in the Paint Fur Tool options, you’re really painting values
for the Polar attribute but in a way that is a bit more intuitive.
When painting the direction, set Inclination to a value other than 0, and the Roll value
must be something other than 0.5. The Base Curl and Tip Curl values must be something
other than 0.5 as well. If these values are not set properly, painting the Direction has no
effect. In addition, Color Feedback has no bearing on the direction of the fur, so you can
turn this option off in the options for the Artisan tool.
3. Open the Attribute Editor for the houndFur node, and use the following settings:
Inclination: 0.8
Roll: 0.2
Base Curl: 0.7
Tip Curl: 0.3
4. Select the houndHead surface. Choose Fur Paint Fur Attributes Tool Options. Wait a
few moments for Maya to update.
5. In the Options box for the Artisan tool, scroll to the bottom. In the Display options, turn
off Color Feedback.
6. In the pop-up options for the Paint Fur Attributes Tool settings, set Fur Attribute to
Direction. Make sure Fur Description is set to houndFur and Attribute Map Width and
Height are set to 1024. The Paint Operation or Value settings in the Artisan options do
not affect how the fur is combed.
7. Drag across the surface to push the fur in the general direction you want it to go. Use
Figure 15.10 for reference. Figure 15.11 shows how the paint stroke influences the direc-
tion of the fur on the model.
Paint lightly and slowly using repeated strokes to make the fur point in the desired direc-
tion. Combing the fur requires some patience and practice. It’s helpful to increase the U
and V samples on the FurFeedback node so that you can see more fur as you are painting.
It can be difficult to maintain a consistent direction across UV seams. The fewer seams you
have in your UV texture coordinates, the easier it will be to paint the direction of the fur.
The Direction attribute responds to the direction in which you move the cursor over the
surface.
8. Save the scene as hound_v04.ma.
To see a version of the scene to this point, open the hound_v04.ma scene from the chapter15\
scenes directory.
addIng Fur to CharaCters | 813
Figure 15.10
Observe the direc-
tion of the fur in this
photo of an Ameri-
can foxhound.
Figure 15.11
Paint the direc-
tion of the fur on
the surface of the
hound. Increase the
U and V Samples
in the fur feedback
node to 256 to
make it easier to
see details in the
fur direction.
814 | Chapter 15 Fur, haIr, and ClothIng
painting across UV texture Borders
As you paint across UV borders on the model, you’ll see the hair suddenly flip around. Since fur
relies on UV texture coordinates to determine how the Polar attribute affects direction, as you
move from one part of the texture space to another, the polarity of the fur can suddenly change (a
good example of this occurs on the back of the hound’s head). This may drive you crazy. To help deal
with these problems, select the model, and choose Display Polygons Texture Border Edges.
This makes the border edges of the UV coordinates visible as bold lines on the surface of the model.
You can also reduce the size of the brush so that you can more easily paint specific areas along the
border. With some patience and work, you’ll be able to make the direction of the fur consistent
across the UV texture border.
Editing the Fur Description: Length
You can edit the Length attribute using the Paint Attributes tool as well. When editing lengths,
you need to pay attention to the values used in the options for the Artisan Brush. For the hound,
the fur is shorter near the end of the nose, is medium length on the face, and is long on the back
of the head and neck.
1. Continue with the scene from the previous section, or open the hound_v04.ma scene from
the chapter15\scenes directory.
2. In the houndHead_furFeedbackShape tab, set U and V Samples to 128.
3. Select the houndHead object, and choose Fur Paint Fur Attributes Tool.
addIng Fur to CharaCters | 815
4. In the pop-up menu for the Paint Fur Attributes Tool settings, set Fur Attribute to Length.
Make sure Fur Description is set to houndFur and Attribute Map Width and Height are
set to 1024.
5. In the options for the Artisan Brush, set Paint Operation to Replace and Value to 0.5.
6. Paint around the area of the neck. You’ll see the fur become longer as you paint
(Figure 15.12).
7. Set Value to 0.25, and paint on the ears, under the ears, the top of the head, and the upper
part of the throat.
8. Set Value to 0.1, and paint the area near the nose and the front of the snout near the lips.
9. To even out the transition between the fur lengths, set Paint Operation to Smooth, and
paint the areas on the border between the different lengths of fur.
10. Save the scene as hound_v05.ma.
To see a version of the scene to this point, open the hound_v05.ma scene from the chapter15\
scenes directory.
After painting fur lengths you may decide to touch up the Direction attribute of the fur as
well. You can change the paint operation mode (from Length to Direction, for example) in the
Paint Fur Attributes Tool Settings pop-up whenever you need to, but remember that Maya may
pause for a few moments to update the maps when you change attributes.
Figure 15.12
Edit the length of
the hair by paint-
ing on areas of
the houndHead
surface.
816 | Chapter 15 Fur, haIr, and ClothIng
Baking textures into Maps
You can use a procedural texture node (such as a ramp, fractal, or checker) as a starting place for a
fur attribute map, as shown here. This works well when you are painting fur applied to a NURBS
surface, since the UV texture coordinates are based on the parameterization of the surface itself.
The following steps demonstrate how to do this.
1. Create a new scene in Maya.
2. Create a NURBS sphere.
3. Select the sphere, and choose Fur Attach Fur Description New.
4. Open the Attribute Editor for the FurDescription1 node.
5. Right-click the field next to Baldness, and choose Create New Texture.
6. From the Create Texture Node window, choose the ramp texture. The fur on the sphere
disappears.
7. Open the Attribute Editor for the ramp texture. Change the colors of the ramp so that the top is
black and the bottom is white. Delete the color marker in the center. The fur display returns.
If you move the markers on the ramp up and down, you’ll notice that the fur display does
not change. In order to use the ramp values to affect the Baldness setting, you need to bake
the ramp.
8. Move the black marker halfway down the ramp, and set Interpolation to None.
9. In the Attribute Editor for the FurDescription node, set Bake Attribute to Baldness, and leave
Map Width and Height set to 256. Click the Bake button.
The fur becomes sparse on part of the sphere. This sparse area corresponds to the black part
of the ramp. You can select the ramp texture in the Hypershade and connect it to the Color
channel of the sphere’s shader if you’d like to see a visual representation of the placement of
the ramp on the sphere.
addIng Fur to CharaCters | 817
10. Move the Black color marker down. The fur on the sphere will not update until you bake the
texture again.
11. In the Attribute Editor for Fur Description, click the Bake button. The fur on the sphere
updates.
To see this example, open the rampBaldness.ma scene from the chapter15\scenes directory
on the DVD.
A good use for this technique would be for applying fur as grass to a NURBS plane. You can use a frac-
tal texture to create procedural variation in baldness or length to make the grass appear patchy.
Test Render Fur
Now that you have the basic fur description created for the houndHead, you may want to see
what it looks like when rendered. You can render the scene using either mental ray or Maya
Software. The results should be fairly similar. In this example, you’ll use mental ray.
1. Continue using the scene from the previous section, or open the hound_v05.ma scene
from the chapter15\scenes folder.
2. Open the Render Settings window, and set the Render Using menu to mental ray.
3. On the Quality tab, set Quality Presets to Production: Rapid Fur (see Figure 15.13). This
preset uses the Rasterizer as the primary renderer instead of raytracing. For more infor-
mation on rendering with mental ray, consult Chapter 12.
Figure 15.13
Choose the Rapid
Fur preset on the
Quality tab of the
Render Settings
window.
818 | Chapter 15 Fur, haIr, and ClothIng
4. Open the Render View window, and create a test render using the perspective camera.
You’ll notice immediately that the fur does not look very realistic (see the upper-left
image in Figure 15.14). It is very sparse and bright red. You need to increase the Density
setting of the fur so that enough hair covers the surface of the model.
5. Set Density in the houndFur tab to 100,000, and create another test render (see the upper-
right image in Figure 5.14).
The fur is much denser without adding too much to the render time. To improve the look
of the fur, you can edit the base and tip widths as well as the basic color.
6. In the houndFur tab in the Attribute Editor, click the color swatch next to Base Color, and
use the Color Chooser to set the color to a dark brown.
7. Set Tip Color to a light brown.
8. Make sure Base Opacity is set to 1, and use the following settings:
Tip Opacity: 0.1
Base Width: 0.01
Tip Width: 0.005
9. Create another test render (see the lower-left image in Figure 5.14).
Figure 15.14
Create test renders
of the fur as you
adjust the settings.
addIng Fur to CharaCters | 819
10. Raise Density to 500,000, and create another test render (see the lower-right image in
Figure 5.14).
11. Save the scene as hound_v06.ma.
To see a version of the scene, open the hound_v06.ma scene from the chapter15\scenes
directory.
The fur should cover the model completely; however, you will notice that some attributes,
such as the baldness map and the direction, may require further editing.
Applying a Color Map
Adding a texture map to the color greatly helps the realism of the fur. You can increase the effi-
ciency of the render by applying the same file texture to the fur color and the shader as applied
to the model. This technique should work as long as the model does not get extremely close to
the camera.
A texture map that has been carefully painted in Photoshop or in a 3D texturing program
works better than a map created by painting color on the fur. In this case, ZBrush was used to
create the color texture map for the hound model.
1. Continue with the scene from the previous section, or open the hound_v06.ma scene from
the chapter15\scenes directory on the DVD.
2. Open the Hypershade, select the houndShader material, and open its Attribute Editor.
3. Click the checkered button next to the Color channel to open the Create Texture Node
window.
4. Click the File button to create a file texture node.
5. In the Attribute Editor for the file node, click the folder icon next to File Name.
6. Use the browser to select the houndBaseColor file texture from the chapter15\
sourceimages directory on the DVD.
7. Press the 6 key to switch to textured view so you can see how the color is placed on the
model.
8. Keep the Hypershade window open. In the Outliner, expand the FurFeedback group, and
select the houndHead_FurFeedback node.
9. In the Attribute Editor, select the houndFur tab.
10. In the Hypershade, switch to the Textures tab. MMB-drag the file1 texture onto the Base
Color swatch in the Attribute Editor for houndFur (see Figure 15.15).
11. In the Hypershade, create a second file texture node (Create 2D Texture File).
12. In the Attribute Editor for file2, load the houndTipColor texture. This is a lighter, less-
saturated version of the base color.
13. Attach this file to the Tip Color channel in the houndFur node.
820 | Chapter 15 Fur, haIr, and ClothIng
14. Lower Specular Color to a dark gray, and set Specular Sharpness to 80. This makes the
specular highlight on the fur smaller and less reflective.
15. Set the Density value of the fur to 250,000 in the houndFur tab, and create a test render
(see the left image in Figure 15.16).
16. To increase the realism of the fur, turn on shadows for the scene lights:
a. Select the spotlight1 object, and open its Attribute Editor.
b. Under Shadows, turn on Use Depth Map Shadows.
c. Set Resolution to 1024, and turn off Use Auto Focus.
d. Create another test render (see the right image in Figure 15.16).
17. Save the scene as hound_v07.ma.
To see a version of the scene, open the hound_v07.ma scene from the chapter15\scenes
directory.
Figure 15.15
Drag the file1
node from the
Textures tab of
the Hypershade
onto the Base
Color channel of
the houndFur
node.
Figure 15.16
Add a color map to
the fur description
(left image), and
render the scene
shadows (right
image).
addIng Fur to CharaCters | 821
Applying Map Offsets and Multipliers
In the Details section of the houndFur node, you’ll notice each attribute has Map Offset, Map
Multiplier, Noise Amplitude, and Noise Frequency settings. These sliders can apply an addi-
tional adjustment to the fur map attributes.
The Map Offset and Multiplier attributes are used to change the range of values for any of
the attributes. Most of the attributes are limited to a range between 0 and 1, which corresponds
to the grayscale values painted on the surface with the Paint Fur Attributes brush. If you would
like to change the range so that it can go beyond 1, you can use Map Offset or Map Multiplier.
Offset adds a number to the overall range. If you want to offset the range for an attribute so
that instead of a range of 0 to 1 the range becomes 2 to 3, set Offset to 2.
If you want to expand or diminish the range of values, use Multiplier. For example, if you
want the range of a value to be between 0 and 10 instead of 0 to 1, set Multiplier to 10.
The Noise Amplitude and Frequency sliders add randomness to the map values.
1. Continue with the scene from the previous section, or open the hound_v07.ma scene from
the chapter15\scenes directory.
The fur for the hound is a little too long to be appropriate for a typical foxhound. Rather
than repaint the Length values, you can simply adjust Multiplier for the Length attribute.
2. Open the Attribute Editor for the houndFur node, and expand the Details Length roll-
out panel.
3. Set Map Multiplier to 0.5.
4. Expand the Tip Ambient Color attribute, and set Noise Amplitude to 0.5 and Noise
Frequency to 25. This adds variation to the brightness of the fur tips.
5. Make sure the texture maps are properly connected in the houndFur tab and on the shader.
6. Create a test render from the perspective camera (Figure 15.17).
7. Save the scene as hound_v08.ma.
To see a version of the scene, open the hound_v08.ma scene from the chapter15\scenes
directory.
Figure 15.17
Shorten the overall
length of the hair
by reducing the
Multiplier value for
the Length attri-
bute. Add variation
to the tip color by
adding noise to the
Tip Ambient Color
attribute.
822 | Chapter 15 Fur, haIr, and ClothIng
Enhancing the Realism of Fur
The basic fur description for the hound has been created, but to make it look realistic, a fair
amount of editing still needs to be done. There are many additional attributes you can use to
help accomplish this. This section describes how these attributes work. As with the Baldness,
Length, Direction, and Color attributes, you can use a single value to determine the overall set-
ting for each attribute, paint values for the attribute on selected areas, or use a texture map to
determine the strength of the selected values.
Inclination, Roll, and Polar are attributes that determine the direction the fur is point-
ing along the surface of the model. As noted, Inclination determines whether the hair points
straight up from the surface (at values closer to 0) or lies along the surface (at values closer to 1).
The Roll setting rotates each hair around the base, and the Polar attribute determines the direc-
tion the fur points along the surface. Roll and Polar can be used together to fine-tune the
direction of the hair. If you have painted a map for the Direction attribute using the Paint Fur
Attributes tool, changing the Polar setting has no effect.
After painting a map for the Direction attribute using the Paint Fur Attributes tool, you may
want to paint values for the Inclination and Roll attributes. This can help define more exactly
the direction in which the fur points along the surface. You may find yourself switching back
and forth among Direction, Inclination, and Roll as you edit the fur on the surface. If you need
precise control over the styling of the fur, be prepared to spend some time working with these
attributes.
Base Opacity and Tip Opacity are self-explanatory attributes. The base of the fur is the part
of the fur strands closest to the surface; the tip is the part of the fur farthest from the surface.
Opacity is applied as a gradient across the length of the fur. To create the look of soft, fine fur,
set Base Opacity to 1 and Tip Opacity to a very low setting or even 0. You can experiment with
these values to create special effects; try a low Base Opacity and a high Tip Opacity.
Base Width and Tip Width establish the shape of the fur strands. A small Tip Width coupled
with a large Base Width produces a pointy shape for the fur. A very low Tip Width helps create
the look of soft, fine fur.
The Base Curl and Tip Curl attributes add curl to the fur strands at the base or tip. A value of
0.5 produces no curling. A value of 1 or 0 produces curling in one direction or the other.
The Scraggle, Scraggle Frequency, and Scraggle Correlation attributes add random kinks
to the hair to create a messy appearance. The Scraggle setting determines the strength of the
scraggle. Scraggle Frequency determines how many kinks appear in each strand of fur. Scraggle
Correlation determines how the Scraggle value of one strand affects another. A setting of 0
for Scraggle Correlation creates random kinks throughout the fur strands, and a Scraggle
Correlation of 1 means all the fur strands kink the same way, creating a wavy appearance for
the fur.
The Clumping, Clumping Frequency, and Clump Shape settings cause the fur strands to
attract each other into bunches on the surface. This is useful for making a surface appear wet
or matted. The Clumping setting sets the strength of the clumping, and Clumping Frequency
determines the number of clumps created across the surface. Clumping Frequency ranges
between 0 and 100; higher values take longer to render. Clump Shape determines whether the
clumps themselves are convex or concave. Settings closer to -10 produce concave clump shapes,
while settings closer to 10 produce convex clumps (Figure 15.18).
addIng dynaMIC MotIon to Fur | 823
Adding Dynamic Motion to Fur
Creating dynamic motion for fur is actually quite easy. A fur description node uses dynamic
hair curves to control the movement of the fur.
Attaching a Fur Description to Hair Curves
In this example, you’ll add a hair system to a simple NURBS sphere that already has fur applied.
The hair curves will then be used to add dynamic motion to the fur.
1. Open the furBall_v01.ma scene from the chapter15\scenes directory on the DVD.
The Baldness attribute of the fur has been created using a ramp texture that has been
baked into the fur description.
2. Right-click the sphere, and choose Surface Point.
3. Hold the Shift key, and select 10 or 12 surface points at the top of the sphere (see
Figure 15.19).
4. Switch to the Dynamics menu set, and choose Hair Create Hair Options.
5. In the Create Hair Options box, set Output to NURBS Curves, and choose At Selected
Points Faces. Leave the other settings at their default values.
adding hairs to polygons
If fur is applied to a polygon surface, select the faces of the surface before adding the hair curves. If
you want to add hair curves all over the surface rather than at specific points/faces, choose the Grid
option on the Create Hair Option box.
Figure 15.18
Clumping is dem-
onstrated on two
planes. The plane
on the left has
a Clump Shape
value of -10; the
plane on the
right has a Clump
Shape value of 10.
824 | Chapter 15 Fur, haIr, and ClothIng
6. Click the Create Hairs button to make the hairs. The hair curves appear as longer curves
coming out of the surface of the sphere.
7. Open the Outliner, and select the hairSystem1 node.
8. Switch to the Rendering menu set, and choose Fur Attach Hairsystem To Fur
FurDescription1.
9. Set the timeline to 200, and play the scene. As the hair curves fall, the strands of fur fol-
low. Try animating the sphere so that it moves around the scene (see Figure 15.20).
10. Save the scene as furBall_v02.ma.
Figure 15.19
Select surface
points at the top
of the sphere.
Figure 15.20
The strands of fur
follow the motion
of the hair curves.
renderIng Fur usIng Mental ray | 825
To see a version of the scene, open the furBall_v02.ma scene from the chapter15\scenes
folder on the DVD.
To keep the hair from penetrating the NURBS sphere, you need to make the sphere a collision
object for the hair curves. This along with other dynamic properties of hair curves is discussed
later in the chapter. Essentially, any dynamics added to the hair curves are inherited by the fur.
Rendering Fur Using mental ray
You can render fur using mental ray or Maya Software. When rendering with Maya Software,
you’ll need to add a fur shadowing node to the lights in the scene. In this section, you’ll learn
how to render fur with mental ray, which generally produces a more realistic result than Maya
Software.
If you plan to use depth map shadows, use the Production: Rapid Fur preset. If you plan
to use ray trace shadows, use the Production: Fine Trace Render preset. If you need the fur to
appear in reflections or refractions, use raytracing.
Fur renders use indirect lighting techniques such as Final Gathering. Be aware that the ren-
der times for dense fur descriptions when Final Gathering is enabled can be quite long.
Rendering Fur Using Raytracing
To create a realistic render of the hound using raytracing, follow these steps:
1. Open the hound_v08.ma scene from the chapter15\scenes directory.
2. Open the Hypershade, and select the houndShader material.
3. In the attributes for the material, set the Diffuse attribute to 1. Increasing the Diffuse
quality of the shader can sometimes help blend the surface material with the color of
the fur.
4. Open the Render Settings window, and select the Quality tab. Set Quality Presets to
Production: Fine Trace.
5. In the Outliner, select the spotlight, and open its Attribute Editor.
6. Under Shadows, turn on Use Ray Trace Shadows.
The Fur/Shadowing attributes listed below the Use Ray Trace Shadows settings are used
specifically when rendering with Maya Software, which requires that the shadow-casting
lights be connected to the fur description. This is not necessary when rendering with
mental ray.
7. Create a directional light. Rotate the light so that it is shining toward the camera. This
creates nice fill lighting as well as a fringe of light along the edge of the fur.
8. In the settings for the directional light, turn off Emit Specular, and set Intensity to 0.8.
9. In the Outliner, expand the FurFeedback group, and select the houndHead_FurFeedback
node. In the Attribute Editor, click the houndFur node.
826 | Chapter 15 Fur, haIr, and ClothIng
10. Set Density to 500,000. Scroll down to the list of Attributes. Set Tip Opacity to 0 and Base
Opacity to 0.5. This helps soften the look of the fur.
11. Set Base Width to 0.008 and Tip Width to 0.001.
12. Create a test render from the perspective camera. The scene takes between five and eight
minutes to render depending on your machine (see Figure 15.21).
13. Save the scene as hound_v09.ma.
To see a finished version of the scene, open the hound_v09.ma scene from the chapter15\
scenes directory on the DVD.
You can continue to improve the look of the fur by improving the texture maps applied to the
fur description as well as by improving the lighting in the scene.
Maya Fur does a pretty good job creating fur effects for many typical situations. For truly
stunning fur and hair effects, you may want to consider using the Shave and a Haircut plug-in
developed for Maya by Joe Alter. This plug-in has been used for many feature films and televi-
sion shows. For more information, visit www.joealter.com.
Animating Using Dynamic Curves
Dynamic curves are NURBS curves that have dynamic properties. The primary use of dynamic
curves is to drive the dynamics of hair systems applied to characters. However, the usefulness
of dynamic curves goes far beyond creating hair motion. Curves used to loft or extrude surfaces,
curves used for Paint Effects strokes, curves projected on NURBS surfaces, curves used as IK
splines, curves used as particle emitters, and so on, can be made dynamic, thus opening up
a large number of possibilities for creating additional dynamic effects in Maya. Furthermore,
Figure 15.21
Render the hound
using ray trace
shadows.
anIMatIng usIng dynaMIC CurVes | 827
dynamic curves calculate fairly quickly compared to nCloth, making surfaces created from
lofted dynamic curves a useful alternative to nCloth for some situations.
While working through the scenes in this chapter, you may want to set the timeline prefer-
ences to loop so that you can see the hair update continuously as you adjust its settings. To do
this, follow these steps:
1. Choose Window Settings/Preferences Preferences.
2. Choose the Time Slider category in the Preferences box.
3. Set Looping to Continuous.
Dynamic Curves vs. Nucleus
As you learn about dynamic curves, you’ll immediately notice many similarities between the
interfaces for dynamic curves and Nucleus, yet dynamic curves are not part of nDynamics. This
is because the introduction of dynamic curves predates the introduction of nDynamics and the
Nucleus solver.
Using Dynamic Curves with iK Splines
In Chapter 7, you learned about the IK Spline tool, which uses a curve to control the Inverse
Kinematics (IK) of a joint chain. The curve itself can be converted into a dynamic curve that can
be used to drive the IK Spline tool. This is a great way to add dynamic motion to a rig used for
tails or tentacles.
In this example, you’ll use a dynamic curve to control a segmented armored tail. The
armored tail consists of polygon pieces, each of which has been parent-constrained to a joint in a
chain. The first step is to create a curve (see Figure 15.22).
1. Open the armoredTail_v01.ma scene from the chapter15\scenes folder on the DVD.
2. Switch to a side view, and turn on Point Snapping.
Figure 15.22
The armored tail
consists of polygon
pieces constrained
to a joint chain.
828 | Chapter 15 Fur, haIr, and ClothIng
3. In the viewport’s Show menu, turn off the visibility of polygons so only the joints are
visible.
4. Choose Create EP Curve Tool. Click the first joint in the chain on the far left and the
last joint in the chain on the far right.
5. Press the Enter key to complete the curve.
The EP Curve tool creates a curve that has four CVs. Using the EP Curve tool is an easy
way to create a straight curve. If you want to add more vertices, you can use the Edit
Curves Rebuild Curve command. In the options, specify how many spans you want to
add to the curve. In this example, the curve should work fine with only four CVs.
6. Switch to the perspective view. Turn off the visibility of Joints in the Show menu so only
the curve is visible.
7. Switch to the Dynamics menu set. Select curve1, and choose Hair Make Selected
Curves Dynamic. In the Outliner, a new hairSystem1 node is created as well as two
groups: hairSystem1Follicles and hairSystem1OutputCurves (see Figure 15.23).
Understanding Dynamic hair Curve Nodes
The hairSystem1 node controls the dynamics of the curve; it is similar to the Nucleus solver when
using nDynamics.
The hairSystem1Follicles group contains the follicle1 node and the original curve1. The follicle node
contains settings to control the dynamics of the individual follicles. Some of these settings can override
the hairSystem settings. If you selected a number of curves before issuing the Make Selected Curves
Dynamic command, the hairSystem1Follicles group would contain a follicle node for each curve. This
is explored later on when creating hair for a character.
The hairSystem1OutputCurves group creates a duplicate curve named curve2. This curve is a dupli-
cate of the original curve. The output curve is the dynamic curve; the curve in the follicle group is
the original, nondynamic curve. The purpose of the nondynamic curve is to serve as an attractor
for the dynamic curve if needed. The dynamic curve gets its shape from the follicle curve.
8. Set the timeline to 200, and click the Play button. You’ll see the dynamic curve move a
little (it can be a little hard to see; this will be more obvious in the next step).
9. Stop the playback, and switch to the hairSystem1 tab.
10. In the Dynamics rollout panel, set the Stiffness value to 0, and play the scene. You’ll see
the dynamic curve droop a little. As the scene is playing, increase Length Flex.
Figure 15.23
A number of nodes
are added to the
scene when a curve
is made dynamic.
anIMatIng usIng dynaMIC CurVes | 829
The Stiffness setting controls the rigidity of the curve. A higher Stiffness setting makes
the curve less flexible. Lowering the Stiffness value makes the curve bend easily.
As you increase the Length Flex value, the curve stretches as much as it needs to in order
to accommodate the dynamic forces applied to the curve. You’ll notice the curve droop
downward, indicating that it has weight. The hairSystem1 shape has a Gravity setting
built in, much like the Nucleus solver discussed in Chapter 13.
You’ll notice that both ends of the curve appear to be attached to the original curve
(Figure 15.24).
11. Stop the playback, and rewind the animation.
12. Set Length Flex to 0.5 and Stiffness to 0.1.
13. Select the follicle1 node in the Outliner, and switch to the Move tool (turn off Grid or
Point Snapping if it is still on).
14. Choose Solvers Interactive Playback. The animation starts playing automatically. As it
is playing, move the follicle around in the scene; you’ll see the dynamic curve follow the
movements.
15. Stop the animation, and switch to the follicleShape1 tab in the Attribute Editor.
16. Set the Point Lock menu to Base. Turn on Interactive Playback, and move the follicle
around again. You’ll see that the dynamic curve is attached at only one end.
If you wanted the curve to be attached to the other end, you’d set Point Lock to Tip. To
detach the curve entirely, set Point Lock to No Attach.
17. Stop the animation, and rewind the playback.
Figure 15.24
The dynamic curve
droops as if it is
attached at both
ends to the original
curve.
830 | Chapter 15 Fur, haIr, and ClothIng
Keyframe point Lock
The Point Lock attribute can be keyframed in the Channel Box for the follicle node. To animate a
dynamic curve detaching from one end, follow these steps:
1. Set Point Lock to Both Ends.
2. Create a keyframe by right-clicking the Point Lock channel in the Channel Box and choosing
Key Selected.
3. Change the current frame on the timeline.
4. Set Point Lock to Tip or Base (the opposite end will become detached).
5. Set another keyframe.
This is a good way to create the effect of a cable or rope snapping.
18. Select the follicle node, and set the Translate channels to 0 to return the curve to its start
position.
19. With the follicle selected, turn on Point Snapping.
20. Hold the d key, and use the Move tool to move the pivot point of the follicle to the end of
the curve on the side where the dynamic curve is still attached, as shown in Figure 15.25.
tips for Moving the pivot point
As you move the pivot point, the curve should not move; sometimes it takes a couple of tries to get
Maya to properly switch to move pivot mode. An alternative to the d hotkey is to press the Insert
key on a PC or the Home key on a Mac on the keyboard while the Move tool is activated—not every
keyboard has an Insert key, however.
Figure 15.25
Move the pivot
point of the follicle
to the end of the
curve.
anIMatIng usIng dynaMIC CurVes | 831
21. When the pivot point is repositioned, Shift+click the Translate and Rotate channels in the
Channel Box, right-click, and choose Key Selected from the pop-up menu.
22. Turn on Auto Keyframe; go to various points in the animation, and move and rotate the
follicle.
While Auto Keyframe is on, a keyframe is placed on all the Translate and Rotate channels
as you make changes to the position of the follicle. The dynamic curve may not update
correctly as you make changes; don’t worry about that at the moment.
You want to create an animation where the curve moves around in the scene like a sword
slashing through the air.
23. Rewind and play the animation; you’ll see the dynamic curve follow the movements of
the follicle as it moves through the air.
24. Save the scene as armoredTail_v02.ma.
To see a version of the scene, open the armoredTail_v02.ma scene from the chapter15\
scenes directory.
Creating an iK Spline Handle from the Dynamic Curve
In this section, you’ll create an IK spline handle for the armored tail and attach it to the dynamic
curve. The dynamics of the curve will be edited to change the behavior of the tail.
1. Continue with the scene from the previous section, or open the armoredTail_v02.ma
scene from the chapter15\scenes directory.
2. In the perspective view, turn on the visibility of joints in the Show menu.
3. In the Outliner, select and hide the follicle1 node. This prevents you from selecting the
wrong curve when creating the IK spline handle.
4. Switch to the Animation menu set, and choose Skeleton IK Spline Handle Tool
Options.
5. In the options, make sure Auto Create Curve and Snap Curve To Root are both off.
6. With the IK Spline Handle tool active, select the first joint in the chain and the last joint in
the chain.
7. Zoom in closely, and carefully select the blue curve that runs down the center of the
chain.
If the operation is successful, you’ll see the ikHandle1 node appear in the Outliner. The
Dynamic curve (curve2) will move out of the hairSystem1OutputCurves group. That
should not affect how the curve behaves.
8. Rewind and play the scene. The joints follow the motion of the curves.
9. In the Show menu of the perspective view, turn the visibility of polygons back on, and
play the scene. The armored tail thrashes around when you play the animation.
832 | Chapter 15 Fur, haIr, and ClothIng
10. In the Outliner, select the hairSystem1 node, and open its Attribute Editor to the
hairSystem Shape1 tab.
11. Scroll down, and expand the Dynamics section.
The Stiffness Scale edit curve changes the stiffness of the curve along the length of the
curve. The left side of the curve corresponds to the stiffness at the base; the right side of
the curve corresponds to the stiffness at the tip.
12. Add a point to the Stiffness Scale edit curve by clicking the left side of the curve and
dragging downward.
13. Play the animation, and you’ll see the end of the tail lag behind the motion more than the
front of the tail. You should be able to edit the curve while the animation is playing and
observe the changes (see Figure 15.26).
14. Save the scene as armoredTail_v03.ma.
Figure 15.26
Editing the
Stiffness Scale
curve changes the
stiffness along
the length of the
dynamic hair.
The Stiffness setting creates the overall stiffness value for the dynamic curve. Stiffness Scale
modifies that value along the length of the curve. Both settings, like almost all of the dynamic
curve settings, can be animated.
To see a version of the scene, open the armoredTail_v03.ma file from the chapter15\scenes
directory.
Using Forces
The settings in the Forces section add levels of control for the curve’s motion. Play the animation
in the armoredTail_v03.ma scene, and adjust these settings while the scene loops so you can
see how they affect the motion of the tail.
addIng haIr to a CharaCter | 833
The Iterations setting affects how the hair responds to stiffness and dynamics. Iterations
refers to the number of times the hair solver calculates per time step, similar to the Substeps set-
ting on the Nucleus node. Increase it to improve the accuracy of the hair motion; higher values
slow down Maya’s playback.
Drag Creates friction between the dynamic curve and the air. Increasing this is a good way
to simulate the motion of hair in thick fluids.
Motion Drag Similar to Drag. However, Motion Drag is affected by the Stiffness Scale
attribute. In other words, the Drag setting creates a drag in the motion across the length of
the dynamic curve, whereas Motion Drag creates a drag along the length of the curve that
is influenced by the Stiffness Scale curve. This can be used to fine-tune the motion of the
dynamic curve.
Damp Used most often to control erratic motion of dynamic curves. Higher Damp values
decrease the momentum of the curve as it follows the motion of the follicle.
Friction Reduces the motion of dynamic curves when they collide with surfaces. This won’t
produce a visible effect unless the curve comes in contact with a collision surface. Collisions
are discussed in more detail later in the chapter.
Mass Affects the motion of the curve only when additional fields (created from the
Dynamics menu set) are applied to the curve, for example, a Turbulence or a Drag field. Mass
does not change how the curve responds to forces created in the hairSystem1 shape node.
Increasing Mass increases the simulated weight of each CV on the curve as the curve moves
through a dynamic field.
Dynamics Weight Controls the amount of overall influence external dynamic fields (such
as Turbulence and Drag) have over the dynamic curve. It does not affect how the Forces set-
tings in the hairSystem node affect the dynamic curve.
Start Curve Attract Creates an attraction between the original curve (curve1 in the
armoredTail example) and the dynamic curve. This can be used to blend between the
dynamic curve and animation created through the use of deformers on the original curve.
The Attraction Scale curve can be used to edit the strength of the attraction along the length
of the curve, similar to the Stiffness Scale.
Adding Hair to a Character
Hair is created by attaching follicle nodes to a surface. Each follicle node controls a number
of hairs. The follicles themselves are styled using a combination of control curves and forces.
Follicles and control curves are connected to a hair system node. A single hair system node can
control hair connected to any number of surfaces, and a single surface can be attached to mul-
tiple hair systems.
When you create hair, you have to consider how you plan to render it. You have the choice
of creating Paint Effects strokes for the hair or curves that can be used to render in third-party
rendering engines such as Render Man, or you can create both Paint Effects strokes and curves.
Even though hair uses Paint Effects, it renders using mental ray without the need to convert the
hair to polygons.
In this section, you’ll create and style hair for a character.
834 | Chapter 15 Fur, haIr, and ClothIng
Applying Hair to a Surface
When you want to apply hair to a character, you can either apply the hair uniformly to the entire
surface or paint the hair selectively on parts of the surface.
It is common practice to create a nonrendering scalp surface that can be parented to a
character’s head and then apply the hair to the scalp surface rather than directly to the char-
acter’s head. This allows flexibility because scalp surfaces and their attached hair can easily
be swapped between characters. It also speeds up playback in the animation because the hair
dynamics are not factored into the calculations required to deform the character’s surface if it
has been skinned to a skeleton or to other deformers.
Some animators like to apply separate hair systems to each part of the scalp to control the var-
ious sections of a particular hairstyle. For instance, one hair system may be applied to the bangs
that hang over the character’s forehead, while another system is used for the hair on the back of
the head. In this exercise, you’ll keep things simple by using a single hair system for the charac-
ter’s hairstyle. Both methods are valid, and as you become comfortable working with hair, you
may want to experiment with different techniques to see which approach works best for you.
The following procedure uses the Nancy Hair scene, which contains the rigged nancy char-
acter used in Chapter 6. The head is rigged to a series of joints. You can select and rotate the
headCtrl curves above the head to change the position of the head. A scalp surface has been cre-
ated by duplicating part of the head geometry. This scalp geometry is parent-constrained to one
of the joints in the head rig.
You can apply hair to NURBS or polygon surfaces. When using polygon surfaces, the UV
texture coordinates must be mapped so that none of the UVs overlap and the coordinates fit
within the 0 to 1 range in the UV Texture Editor. As with fur, you’ll get better results from your
hair system if the UV coordinates have been carefully mapped. Remember to delete history for
the surface once you have created UV texture coordinates to keep the coordinates (and attached
hair) from moving unpredictably during animation.
1. Open the nancyHair_v01.ma scene from the chapter15\scenes directory.
2. In the Outliner, select the scalp surface, and open its Attribute Editor.
3. In the scalpShape tab, expand the Render Stats section; then turn off Casts Shadows,
Receive Shadows, Motion Blur, and Primary Visibility so the surface will not render or
affect any other geometry in the render.
adding hair to a Surface
You can add hair to a surface in a number of ways. You can paint hair on the surface using the Artisan
Brush interface, you can select faces on polygons or surface points on NURBS surfaces and apply
hair to the selected components, or you can create a uniform grid of follicles on a surface. Once you
attach follicles to a surface, you can add more follicles later to fill in blank areas by painting them
on the surface.
For the scalp you’ll create a simple grid and then add follicles if needed later.
4. Select the scalp surface, switch to the Dynamics menu set, and choose Hair Create
Hair Options.
addIng haIr to a CharaCter | 835
5. In the Create Hair Options box, choose Edit Reset to reset the options to the default
settings.
6. Set the Output to Paint Effects, and choose the Grid option. Use the following settings:
U and V Count: 24
Points Per Hair: 20
Passive Fill: 1
Randomization: 0.1
Understanding Follicle types
Follicles can be dynamic, passive, or static:
Dynamic follicles Dynamic follicles react to forces and dynamic fields based on the set-
tings in the hairSystem node or on any dynamic overrides created in the follicle shape node.
Dynamic follicles can collide with surfaces.
Passive follicles Passive follicles inherit the dynamic motion of nearby dynamic follicles,
which can reduce computational overhead, especially when collisions are involved.
Static follicles Static follicles have no dynamic motion but can be used to style parts of
the hair. You can change the mode of a follicle after creating the hair system if you decide to
make a passive follicle dynamic, make a dynamic follicle static, or use any other of the three
modes.
The Randomization setting randomizes the arrangement of the grid to make the hair placement
look less even.
By increasing the Passive Fill option, a number of the follicles created when the hair is attached to
the surface will be passive rather than dynamic. If the Passive Fill option is set to 1, every other row
and column of the follicles based on the settings for U and V Count will be passive follicles. If the
setting is 2, every two rows and every two columns of follicles will be passive.
When you first create a hair system, you can create a number of passive follicles using this setting.
This speeds up the dynamics as you create the initial hairstyle. Later you can convert the follicles
to dynamic or static follicles as needed.
7. Turn on the Edge Bounded and Equalize options.
When the Grid method is used, the follicles are placed uniformly on the surface based
on the U and V coordinates. If Edge Bounded is on, the follicles are placed up to and
including the edge of the UV coordinates. In the case of the example, this means hairs
are placed along the edge of the scalp surface. The Equalize option evens out the spacing
of the follicle placement to compensate for areas of the U and V coordinates that may be
stretched or squashed.
8. Set Points Per Hair to 20 and Length to 5.
Hairs that have more points per curve are more flexible and have more detail in their
motion as they respond to dynamics; they also slow down the playback speed of Maya in
the scene. The Length attribute can be modified after creation.
836 | Chapter 15 Fur, haIr, and ClothIng
The Place Hairs Into option should be set to New Hair System. If a hair system exists
in the scene already, you can use this option to add the newly created hairs into the
existing system by selecting it from the list. Figure 15.27 shows the settings for the
new hair.
9. Click Create Hairs to make the hair. The hairs appear as long spikes coming out of
the head (see Figure 15.28).
10. Click Play on the scene, and the hairs start to fall. After a few moments, the hairs start
to settle.
11. Save the scene as nancyHair_v02.ma.
To see a version of the scene, open the nancyHair_v02.ma scene from the chapter15\scenes
directory.
In the next section, you’ll learn how to style the hair.
Figure 15.27
The Create Hair
Options area
Figure 15.28
The hairs appear
as long spikes on
the top of the head.
When you click the
Play button, the
hairs fall and settle
into a basic hair
shape.
addIng haIr to a CharaCter | 837
hair transplants
You can move an existing hair system from one surface to another surface using the Transplant
command. To use this command, follow these steps:
1. Select the hair system you want to move.
2. Ctrl+click the destination surface.
3. From the Dynamics menu set, choose Hair Transplant Hair.
If the surfaces have very similar U
Các file đính kèm theo tài liệu này:
- mastering_autodesk_maya_201100009_1556.pdf