The first step in creating the hair will be to prepare our model. Below is a picture of one of my models that I will be rubbing Rogaine on :) I wanted him to have a slicked back pony tail, so we'll be focusing on that type of hair, but you can use these same methods to create many types of hair.
(All of the pictures in this tutorial can be clicked on to enlarge them)
Screenshot of Model
In this example, I have constructed my head via Sub-Division of Surfaces, so it is made up of polys. Since we can't use Paint FX directly on Polys, we have to prep our model by making a nurbs skull so that we can paint on it. This doesn't have to be anything super precise, just make a sphere and deform it so that it fits the top and back of the head where the hair is, and lies just under the model. Obliviously if you were using a nurbs model, you could skip this step and proceed on down. In my case, I made two half spheres:
Screenshot of Nurbs Hair Skull
The next thing I did was make a "holder" for my ponytail. This can be anything you want, but for the sake of simplicity in this tutorial, I just made a cylinder and scaled one end to be larger than the other. In case any of you wonder, when I made my model, I left a hole in the back of the head, since I knew it was going to be covered by hair anyway: This is the model with the ponytail "holder":
Model and Ponytail Holder
This where things start to get interesting and we begin to actually lay down the foundation for the hair. Look at your model and decide how you want the hair to flow. You will use Nurbs curves to "draw" the flow of the hair. In my instance, I needed hair that appeared to be pulled back tightly, without much frizzle or noise. Here are the curves I drew to control the hair:
Control Curves for PaintFX Hair
Notice how they all stop at the ponytail holder. The reason for this is that if I do want to have some bounce on the ponytail when I'm animating, I don't want the extra overhead of putting dynamics on the whole head, just the ponytail. With that in mind, I want to model the ponytail separately.
that we have the control curves in place for the hair, we will lay down
our first patch of hair. From my experience, getting the hair to flow
precisely where you want it (especially as tight as a ponytail will
be) takes a great deal of fine tuning the PaintFX brush to respond to
the curve the way you want it. This process is much more manageable
in smaller chunks of hair, so I tend to build that way. There are already
some decent hair brushes that you can find on the AW site, so I have
included a link to them as well as the brush I modified specifically
for the ponytail look. Click HERE to download the Maya shelf file that has the preset FX brushes on it. (To install the file, place it in your shelves directory or you can load it manually through the shelf menu).
you open the shelf in Maya there will be two icons that we'll use in
a later tutorial for the dynamics, and the last brushes are PaintFX
settings for Hair. The first three are for long hair, that doesn't have
to conform to something as condensed as a ponytail. The last brush is
the brush I created specifically for something as thick and uniform
as a slicked back ponytail. Before we select the brush, we must make
our Nurbs Skull paintable. Select your "skull" and go to the paint effects menu > make paintable. Now we can lay down our first stroke. Then select your base mesh and template it, so that we can still see the mesh, but it won't be affected by anything we do in the viewport. Select the the ponytail brush (the last one) on the shelf. The cursor should change the paintFX cursor. Draw a curve along the top part of your Skull where you want the hairline to be. This should leave a trail of hair as your drawing, which will appear to "grow" until you stop drawing.
First PaintFX stroke along scalp
the present time, the hair is sticking straight up, based on the normal
at the time you were painting. Doesn't really look much like slicked
back hair yet, but were almost there. First thing you may notice (unless
you have been blessed with running Maya on a 150 processor Octane Reality
Machine with 2 terabytes of ram and a Wildcat 50000) is that the viewport
slows down considerably after the stroke is laid. We don't really need
to see a ton of FX strokes in the viewport to know how our hair is going
to flow, so click on the brush stroke you have just created (easiest
way to do this is in the outliner) and then set the "display percent"
attribute in the channel box to something like 1 or less. This will
restore the viewport to a more responsive state. Now were going to make
the hair flow with the control curves we have made. Select the new hair
stroke, and then add all of your control curves to that selection. With
all of them selected, go to paint effects>curve utilities>set
control curves. This should make hair stretch and flow in the direction of the control curves, like this:
PaintFX stroke flowing in direction of control curves
you render your hair at this point, with the render globals set
a production quality, it should look something like this:
First you'll notice that there are gaps in the hair where you can see the skull/scalp. This is okay, because I usually add one more layer of hair to the top to give it a little more density. Any gaps that are left over won't matter, because the very last part of the illusion is creating a texture map on the model the color of the hair, so it looks like there is more hair beneath the gaps. That way we don't have to spend insane render times trying to fit hair in EVERY single little gap.
From this point, just keep adding hair curves along the scalp line on your model. Periodically up the display percentage on your hair to see what the full thickness of the strokes look like. This will save you time from doing a full blown render. Once you think things look good in the 3d viewport, to a full render occasionally to double check. In some instances, it may be necessary to add control curves to handle troublesome spots. Because the hair on my model was pulled back so tightly I needed to add curves above the ears to handle that particular patch:
Hair control curves added to side
Once you have the majority of your hair strokes in place, a full render should look something like this:
Full Maya render of main hair segments
You notice that some of the hair pokes into the ponytail holder and clips the surface.. At this point, you may have to go back and move your control curves to adjust the flow of the hair so that at least the majority of the hair goes right in to the ponytail holder.
Now we are ready to create the final piece, the ponytail. To speed things up, hide the hair strokes you have created so far, they will only slow things down and we'll unhide them later when we want to see how it all works together. First make 4 control curves for your ponytail, to control the shape of the top, bottom, left, and right sides of it. They should look something like this:
Ponytail control curves
Now we need a surface to create the hair on. This will depend greatly upon what you want the hair coming out of, but in my case the ponytail holder is round. A simple nurbs circle converted to a planar surface was all I needed. I positioned the new surface toward the back of my ponytail holder, and then drew a paint FX curve on it. With the display percentage cranked up a bit and the hair bound to my control curves, the result looked like this:
Ponytail in viewport
Once you have the ponytail looking good, turn the rest of the hair back on and do a final render! You made your first PaintFX hair!
Final Render of Hair
Again, you'll have to go back and tweak the control curves and/or the ponytail holder to make sure that the hair doesn't clip the surface. It's impossible to control individual stray strands of paintFX hair, so just get it as good as you can and then scale the holder to do the rest. The last step is to make the texture map on the scalp area of your model the same colors as your hair, so that any cracks appear to have hair below it.
Hopefully soon I can put a tutorial up that will show you how to use Maya cloth/dynamics to drive the control curves on the hair and bring the ponytail to life during the animation. If you have any questions or additons to the tutorial, feel free to post your question in the Maya forum at CreativeCOW.net.
--Chad Briggs is a leader in the CreativeCOW Maya forum.