Tuesday, July 16, 2024

Hair Simulation

It is well known that it is not straightforward to simulate hair curves in Blender. Recently Alessandro pointed me to an interesting video where this problem is addressed:
The main idea is to create a proxy mesh which exactly matches the hair curve's vertex order and vertex locations. We can then add a cloth simulation to the proxy mesh, and a geometry node modifier to the hair curve that makes if follow the proxy. This is implemented in the development version 4.2.0.

Hair simulation does not work with the well-known Toulouse hair, because it contains connected sheets with two tips at the end and the root in the middle, and the Make Hair tool does not handle this case well.

Monica hair is better behaved, and only consists of sheets where the root and tip are at the ends. We imported a G8F character with Monica hair.

Monica hair consists of several parts with different materials. First we enter edit mode and separate the mesh by material.
We only keep the hair meshes which make a substantial contribution to the hair. The four meshes that consist of scattered small parts can be deleted. Also, the mesh with the cap material is renamed to "Scalp".
Next we convert each of the four remaining hair meshes to hair curves. With the hair mesh active and the scalp selected, press Make Hair.
The simulation options are found in the new Posing/Simulation box to the right of the Make Hair options. To make the video above I used something like the options above.
After converting all four hair meshes to hair curves, we end up with four hair curves and four proxy meshes, which have a red material in the viewport and are hidden during rendering. I like to put them in separate collections for clarity.

After that it is just a matter of animating the character.

The simulation will probably not be perfect at once. We can tweak the simulation parameters in the physics context as usual.

We can also easily modify the pinning group with Add Pinning Group.