Sunday, November 22, 2020

Hair Improvements

Update November 23. Mesh hair can no longer be converted into particle hair during import. Use the Make Hair tool to expliticly make the conversion afterwards. See this post for details.

 Here is the Hair section of the Global Settings dialog.


We notice that the Strands As Hair option is gone. It is replaced by the Strand Type option, which can take on three different values: Mesh, Line, and Hair. These control how strand-based and polyline hair are imported.

As mentioned in the previous post, we must turn on Preview PR Hairs in DAZ Studio and set Render Line Tesselation Sides to a number greater than or equal to 2, and then export a dsf file with the hair data. When Strand Type = Mesh, the Daz Importer imports the tesselated meshes directly, without doing anything further. The strands are then narrow tubes. The picture above illustrates a typical strand when Tesselation = 4.

Here we have chosen Strand Type = Line instead. The strands are still meshes, but the faces have now been collapsed into one-dimensional edges. Polyline hair is imported as one-dimensional meshes also when Strand Type = Mesh, because polylines are always one-dimensional.

Finally, when Strand Type = Hair, the strands are converted into particle hair in Blender.

The Advanced Setup > Hair > Make Hair tool also offers new ways to convert mesh hair into particle hair, reusing the code used to import hair. The dialog displayed by the Make Hair button has a new line below Hair Color, which specifies the type of strands in the mesh hair. Depending on the type chosen, different algorithms are applied to create particle hair.

As always, we must delete any hair cap before creating particle hair, or separate it from the hair mesh.

Sheet is the old method for converting hair. It is applicable if the strands are two-dimensional sheets, e.g. the standard Toulouse hair. The sheets must be oriented vertically in UV space. This method does not work if the strands are tubes.

Line is applicable if the hair mesh consists of edges only. An example is the standard Mohawk hair, if it is imported with Strand Type set to Mesh or Line. Importing hair as polylines and then making hair with strand type = Line is essentially the same thing as importing hair as particle hair directly. However, the advantage of the two-stage process is that the hair survives the merging of geografts, something that particle hair does not.
Finally, the Tube option is applicable if the hairs are narrow tubes. The tubes can either be narrow 2D ribbons or 3D meshes, the important thing is that the vertex separation along the tube is much larger than the thickness. There is probably also necessary that vertex numbers increase along the tube.

We could illustrate this with strand-based hair imported with Strand Type = Mesh, but tube-shaped strands can also appear in other assets, such as the hairstyle above. Meshes with many tubes could not be converted to particle hair before.

Here is the corresponding particle hair, in the viewport and rendered.