Hair Creation Workflow
This outlines the steps for turning your hair geo mesh into Maya nHair. The starting point is to have a model with proper edge loops that flow in the direction of the hair. Once this look is approved, the process involves generating guide curves from the geo and then creating hair from those guide curves. These guide curves can then be rigged with the character and exported to an Alembic cache for lighting.



Part I: Generate guide curves from geo

The following method assumes you are extracting the curves from a polygonal model. An alternate method would be to either build NURBS geo, or convert the polys to NURBS (converting it first to subdiv then the NURBS) and then extract isoparms from these with edit curves > offset (with the offset to 0).

  1. Select an edge loop and modify > convert > edge loops to curves. Repeat for each edge loop.
  2. Add more edge loops to get even spacing as needed and convert these to curves.
  3. Edit the curves so they flow nice, don't kink, and don't loop around at the tip.
  4. Rebuild the curves (I did uniform: 4 spans)
  5. Make sure all the curves direction are going the right way. If not reverse them
  6. Group the curves.
    Additional subgroups can be used for organizational purposes as needed


Part II: Make hair from the curves:

    Creating hair on curves
    When hair is attached to curves (using hair > attach hairSystem) the follicles are placed at the origin and do not have an up vector which causes the PFX hair to flip when it is rotated in Y and crosses the X axis (i.e. when the character turns their head). To fix this we need to instead connect the follicle to a geometry which gives it an orientation so the hair does not flip. This is done as follows:
    1. Make a poly sphere and position it inside the character's head. Freeze transformations.
    2. Select your curves and the sphere then hair > make selected curves dynamic [option: "attach to selected surface" ON and "Snap Curve Base to Surface" OFF]
    3. Select the hairSystem and hair > assign PFX brush to hair
    4. Apply the hair preset

    Making the curves editable
    This above method introduces a new problem however: the curves under the follicles have their shape nodes set to intermediate objects, making them invisible and disabling the curves which means we cannot edit them. The same is true for the "create hairSystem" command which is why it appears not to create curves when in reality they are simply disabled. To make our curves editable again we need to do the following steps:
    1. In the Outliner select the follicles group and open the hypergraph
    2. In the hypergraph: Hierarchy do "options > display >shape nodes" and "options > display >hidden nodes"
    3. Then drag select the contents of the group
    4. Open the attribute spreadsheet and in the "all" tab set "intermediate object" off.
    5. In the Outliner select the group for the output curves and hide it.
      This will ensure you do not inadvertently pick these later.
    6. Set the HairSystem simulation method to "static" in the attribute editor.
      This prevents the dynamics from conflicting with your curve edits (if the dynamic stregth is too high the curves will seem to not affect the hair at all). It can be set back to dynamic later once you are done editing and are ready to sim.


Part III: Organize and clean up:

Normally the curves are parented under the follicles attached to the geometry. This allows the hair follow the head's movement including deformations (ex: skinning and/or blend shape expressions). This approach causes several problems however. Most significantly, if we want to be able to keyframe the hair in addition to using dynamics this follicle parenting will cause the dreaded double transform with the hair rig controls. This is not an issue if you only want dynamics, but there is a second possible issue with the curves being embedded under the follicles that may cause an error with the Alembic cache since Alembic can write out curves but will convert follicles to groups. Finally, it is difficult organizationally to edit the curves when they are embedded under the follicles.

The following workflow addresses all of the above issues by organizing the curves and follicles into separate groups and then organizing all of the hair nodes into the non-deforming part of the rig hierarchy in preparation for rigging.

    A. Group follicles and curves separately
    This is a bit tricky since the curves are embedded under the follicles:

    1. Select the curves in the modeling view and group them (hotkey: ctr-G)
      This will get the imbedded curves out and in their own group
    2. Next, select the follicles in the Outliner and group them (hotkey: ctr-G)

    B. Organize into groups in the non-deforming section of the hierarchy
    The non-deforming section is the part of the rig hierarchy that is not moved in order to avoid double transforms and simplify caching. Ideally the hair group would be placed directly below the geometry group in the Outliner.

    • Non-deforming group
      • Geometry Group
      • Hair Group
        • HairSystem group
          • hairSystem
          • pfxHair
        • Dynamics Group
          • nucleus
          • output curves group
        • Style Group
          • the sphere the hair follicles were attached to
          • follicles group
          • curves group

    C. Mass renaming
    In this step we will prefix the name of the asset onto all of the hair nodes. This is crucial to avoid naming clashes which will cause both Alembic and the hair system to fail (for example when rebuilding the hair)

    1. Select the main hair group containing all of the hair nodes
    2. modify > Prefix hierarchy names... and add the asset name with an underscore as a prefix
      (example “Pilot_” without the quotes)
      This will prefix all of the nodes in the hierarchy with the asset name recursively.

    D. Rebuild the curves for Alembic export
    Alembic performs best with evenly spaced curves. The following command keeps the same number of CV points, but spaces them evenly along the curve.

    • Select the curves and Edit curves > rebuild curves with the following options:
      • Uniform
      • Parameter range: Keep
      • Keep: NumSpan
      • Keep: Ends
      • Degree: 3 Cubic


Part IV: Modify follicle curves as needed to shape the hair

This is a type of modeling which involves modifying the control curves to style the hair, and simply requires time and love. You can lower the display quality on the HairSystem to speed up interactive performance. Another tip is to use edit curve > selection > select last CV on curve together with edit curve > modify curve > lock length to get movement similar to those in Shave.



Part V: Rigging the hair

While clusters can be applied to the curve CVs, due to large number of control curves a better approach is to use a wrap deformer. New hair curves can then be added or removed from the wrap without impacting the rig. A simplified version of the original hair mesh can be used as the wrapper. The wrapper geo can then be driven by joints with FK/IK:

  1. Select the curves followed by the geometry and create deformers > wrap
  2. skin the geometry to joints
  3. create controls to drive the joint's FK/IK as desired


A note on dynamics:

In the past there was an issue with dynamics, even when set to static causing slow starts to the render which increased exponentially with the frame count. Consequently we deleted the output curves and nucleus to avoid this. Since this issue has been resolved in vray (see Fixing hair renders slow runup times) it doesn't hurt to keep the dynamics active even if you don't plan on using them. Note however that this is only true when using the school computers which have a special install of vray. This will not work on your vray at home.

Hair materials:

For setting up the vray hair material as well as the object ID for the multimatte, see Hair Material Setup

Return to TopReturn to Content