How to work with nHair in Maya

If you’re creating characters, animals or creatures, chances are they’re either going to need a hairstyle or fur. Just about every 3D application out there gives you the ability to create hair systems for your characters that not only look natural, but also behave in a realistic way during animations. In this article, we’re going to look at Maya’s powerful nHair system. With nHair the computer is literally calculating every strand of hair, of course, depending on your project this may not always fit the style. For instance, maybe you’re working on a cartoonier project, where thick strands of polygons make more sense than the more realistic style of hair that nHair provides you. If that’s the case, then applying a physics system around the polygon hair might work best, but even so, being familiar with nHair and the power that it gives you is vital. For this particular tutorial we’re going to use the Biker model asset. This guy is currently bald, which is fine, but we’re going to add a mohawk to his dome using nHair. So, nHair works a little bit differently than what you may have experienced in different 3D applications. What you first need to do is establish the rough guides for your hair, which you can do by utilizing the various curves in Maya. These guides can then be used to create the nHair follicles. maya_nhair_image01 So with the asset opened in Maya, it’s now time to start creating our hair guides. To do this go to Create>Curve Tools>EP Curve Tool. I’m using Maya 2016 and the UI is slightly different from previous versions, so the EP Curve Tool may be located in Create>EP Curve Tool. maya_nhair_image02 With the EP Curve Tool create one small curve right in the middle of the characters forehead, you can make it as short or as long as you want, and you’ll want at least three points created. You can see in the image above about the size I created. maya_nhair_image03 Take this new curve and begin duplicating it down the top of our character’s head. You’ll need to do some slight rotations and adjustments to some of the curves as you go. maya_nhair_image04 You can see the strip of curves along the characters head in the image above. As you can see we have a very basic structure for the mohawk. Of course, this is just our guides and the mohawk isn't going to be this thin. maya_nhair_image05 Now that we have the first strip of curves created let’s select all the curves and duplicate it two times, setting a new strip on either side. That way our mohawk will be thicker. When you’re happy with the guide placement we can create the nHair and begin tweaking it as needed. maya_nhair_image06 Select all the curves you created and go to nHair>Assign Hair System>New Hair System. This will assign a new hair system along our guides, so that when we add the hair it will get placed where the guides are located. maya_nhair_image07 Now select the character mesh and go to nHair>Create Hair>Option box. Scroll down to the very bottom of the Create Hair Options and under the Place hairs into dropdown box choose the hair system you just created a few moments ago, it should be called something like hairSystemShape1 then choose apply. maya_nhair_image08 You should see that we have hairs placed on our guides, but we also have hair clumps attached to the rest of our character mesh, which we really don’t want. maya_nhair_image09 This can be easily fixed by going into your Outliner and opening up the hairSystem1Follicles and scrolling down until you find bodyFollicle. These are all the follicles that have been placed on areas other than the guides we established, so just delete these. maya_nhair_image10 With that, we’re left with a nice thicket of hair clumps on our characters head. Now, we have the nHair placed along our guides. Of course, we’ll now need to do further adjustments to the nHair properties to get it looking closer to how we want. maya_nhair_image11 Select the hairSystem1 in the Outliner and in the Attribute Editor we can begin to tweak our hairs. In the Clump and Hair Shape properties we can make some adjustments. I upped the Hair Per Clump to around 40. Set the Sub Segments to 3, which smooth’s out each hair strand. I set the Thinning to 0.390. The Clump Width to 0.5. You can see this adds a lot more volume to our hair. maya_nhair_image12 Scroll down to the Shading properties in the hairSystemShape1 and change the hair color to whatever you like. I changed it to a greyish color similar to his eyebrows and beard. maya_nhair_image13 Since we’re using nHair if you play the animation in the timeline you should see that your hair slowly starts to fall. Depending on the look you’re going for this is something you may or may not want. You can adjust the dynamics properties of the hair by opening on the Dynamic Properties panel in the Attribute Editor of the hairSystemShape1 node. You can adjust things like Bend Resistance, and the Stiffness Scale to allow the hair to stay in place more during the simulation. Render While this was just a very basic example of how to use nHair, you can begin experimenting with it in your own projects. The first step is to create your guides using curves, so style the hair roughly how you want it to look and create a new hair system based on these guides.