Braids Haircut for UE4 with nHair and xGen

Recently (UE4.25) Unreal Engine added the possibility to use alembic hair. It’s a revolutionary feature, still beta, but designated to radically change the procedure of creating characters to use with the engine. Thanks to the fact that finally Autodesk offers Maya Indie also in my country, I was able to test this beautiful new feature that Epic has added to its engine.

This little tutorial is about how to create a braid in Maya using nHair and xGen plugins. All I did was to follow this Daryl Obert’s video tutorial and adapt it to my needs. I’m writing this blog post essentially to memorize what I have learned, as I’m a total noob in the matter of creating hair with Maya.

The final result I got after a couple of tries is this:

Scene preparation

  1. Import the character and the scalp meshes into Maya;
  2. Make sure there are no namespaces, use the namespace editor to delete all namespaces that are eventually in the scene; according to this xGen hair tutorial, this is an important step to have xGen working correctly;
  3. Create an xGen collection and an xGen description for the hair that are supposed to have the braids attached, as in the picture.

Braid creation

Now I’m going to create one braid using nHair and xGen. I was really impressed how this procedure is easy and fast.

  1. Go in side view and take the base curve tool; draw a curve in the general direction of the braid you want to create, smooth it a couple of times to avoid having something too crazy, then rebuild it to assure that the curve points are equally spaced (30 spans is a good spans number in my experience);
  2. Go in perspective mode and move the curve laterally from the center to place it where the braid should be attached (this step is not present in the tutorial I’ve followed because there the goal is a single centered braid)- see picture 2; freeze transformation of the curve for safety;
  3. Select the curve and the scalp mesh, go to FX menu -> nHair -> Make Selected Curve Dynamic with “Attach curves to selected surfaces” set to true; in this way the curve is attached to the surface when moving – see picture 3;
  4. If you hit the button “play” the curve start moving, but it doesn’t collide with the character; to have it colliding select the character and go to nCloth->Create passive collider; in this way when you click on the button “play” the curve collides with your character (this step is not really necessary for importing the braids into UE4 as the engine makes the hair simulation, but it could come useful in other cases);
  5. Select the hairSystem, go to the nHair menu and select “Assign paint effects brush to hair”;
  6. Now select the paint effects and set the properties in the attribute editor; see picture 4 for reference;
  7. Select the follicles and in the attribute editor set “Braid” to true (picture 5);
  8. To have the braid more smooth, set “Sub Segments” to 20 (picture 6);
  9. Vary the “Clump width” parameter to change the form of your braid; in picture 7 I’ve reduced it to 2 to show what this does;
  10. Now we want to transform the paint effect hair into xGen hair; xGen doesn’t understand paint effects, so we take the paint effect hair and convert it into curves that can be imported into xGen as guides; in order to do this, select the paint effect hair and go to Modify -> Convert -> Paint effects to curves- see picture 8;
  11. Create a new description for the braids in your xGen collection, in this way you can have different parameters then the rest of the hair. Use the “Curves to guides” utility to import the curves as guides;
  12. In the primitive section of the xGen description, you need a pretty high density (200 in my case) and Modifier CV Count (50 in my case) to have the hair looking as a realistic braid (picture 9); that’s why I’ve separated the braid description from the rest;
  13. Setup you own modifier (noise, cut, clumping) to make the braid look more realistic;
  14. Select the 2 description and convert them into XGen interactive grooming in order to export the cache and import it in UE4 as explained in the UE4 documentation.

Add a Comment

Your email address will not be published. Required fields are marked *