|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.
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).
Part II: Make hair from the 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:
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:
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.
This is a bit tricky since the curves are embedded under the follicles:
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.
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)
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.
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.
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:
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.
For setting up the vray hair material as well as the object ID for the multimatte, see Hair Material Setup