Curve hair modifier stack order

Hello,
My question is regarding the order of the Curve Hair modifiers (their geometry node presets) in the modifier stack for the curve hair.

I seem to remember, unless I am wrong, that the final one (at the bottom of the curve modifiers) was recommended to be Surface Deform) with the Interpolate Hair Curves modifier before it.

That works fine when working with with a plain mesh that is not subdivided. It makes no difference whether the Interpolate Hair Curves modifier is before it or after the Surface Deform, all the hairs stick to the surface.

However, when I add curve hair to a subdivided mesh (that is a mesh with a subdivision surface modifier added to it), having the Interpolate Hair Curves Modifer before the Surface Deform on the Stack causes the interpolated hairs to intersect with the subdivision surface and not sit exactly on the surface.

However, if I drag the Interpolate Hair Curves below the Surface Deform, it works good with the Subdivided mesh.

So my question is, which is right, having the Interpolate Hair Curves sit above or below the Surface Deform?

Thank you!

Issue about hair interpolation may appear, if you rig surface mesh and don’t stick hair to this deformed surface.

Default Surface Deform modifier is doing it, for hair guides created in Sculpt/Edit mode, for geometry considered by modifier.
Interpolation Hair Curves modifier (different than Interpolate Curves node) is doing it, for interpolated hair only, when you precise the Surface object.

Interpolation Hair Curves modifier has a Surface Rest Position option.
If you set this modifier after Surface Deform, the option should be disabled.
If you set this modifier before Surface Deform, the option should be enabled to avoid intersection issues.

Whatever you do with modifier stack on hair guides ; you can use an Attach Hair Curves to Surface modifier at the end of stack, to make them stick to surface.

Dear @zeauro

Thank you very much for your helpful reply. There are some important things in it which I beleive will get it to work

Yes, thank you. When you say “if you rig surface mesh”, do you mean just a subdivided surface mesh, because I haven’t added the rig yet. In other words, it is just a polygonal mesh (of a head) with a subdivision surface on it and no rig. Does that count as “rig surface mesh”.

Thank you. That really helps. What exactly do you mean “when you precise the Surface object”? I am unclear about that.

Great. By toggling that on and off, it fixes the problem. As you say, Off if after Surface Deform, On if before.

I would like to take this opportunity to ask you whether the Interpolate Hair Curves Modifier should exist before or after the Surface Deform modifier? I am working on the head of a character. I plan to add a rig later.

I haven’t tried it yet, but from what I heard, it should go before the Surface Deform if you plan to add, for example, facial rigging and want the hair to stick correctly on the surface of the mesh as the mesh is deformed by the rig controls. Is that a correct understanding?

That is a great. So, in other words, are you saying that the Attach Curves to Surface modifier can go at the end of the stack at any time to make the hairs stick correctly regardless of the order and it can safely be added after the Surface Deform Modifier?

Thank you again!

Joe.

I mean an animated character. I am talking about issue when scalp is moved and deformed by movements of bones of an armature.
There, you can have issues about hair not following the mesh has expected or disappearing. Because hair object is parented to mesh object parented to armature object, but hair curves position may be dependent of UVs of mesh, changing, deformed by bones or armature.
No armature rig. No deformation. No issue.

By default, when you add a Hair Curves object ; it is the children of active mesh. And this mesh and its UVmap are referenced as Surface in Surface panel of Object Data properties of Hair Curves object.
There is a field called Surface that allows to set the name of an object.

There is exactly the same field in Interpolate Hair Curves modifier, I am talking about. You have to reset the same object name.
Unless you want the modifier to produce hair curves on another object than the one where original guides are.

If interpolation is done after Surface Deform, although you precised Surface in Interpolate modifier ; hair distribution will be messed up by distance to guides changing because of deformation.
Result is that some interpolated hair will disappear and others will appear, according to how scalp surface is deformed.

If Interpolate modifier is processed before Surface Deform modifier, there will be no issue.
In theory, if you rig you character to be sure, that scalp surface is not deformed at all (as a separated mesh part for example ; order of modifier should not matter. But, in practice, it looks like there are still occlusion issue, with hair disappearing at boundary of mesh part.

No. Sorry, it was confusing. I was just talking about another modifier with Surface object property.
There are many ways to deform hair, through Deformation modifiers.
Those hair deformations may produce intersections with surface.
Attach Hair Curves modifier is a way to solve that.

But Surface Deform modifier is the only one solving " distance to guides / mesh deformation " issues.

Thank you!

I see. I suppose I was wondering whether Surface Deform made a distinction between adding a rig and using a subdivision modifier on a mesh.

In other words, the question is whether the Surface Deform modifier is only used when working with Armatures or whether it is needed for Subdivision Surfaces as well (in other words, not just meshes made out of unsubdivided polygons)? Another way to put it would be: Is the Surface Deform needed in either case, or only when you deform the mesh by bones?

Having said that, I think I found a way to get it to work (below) and wanted to know what you thought:

The only way I could get it to work without the roots of the hair penetrating the subdivided mesh and sitting precisely on the surface was to:

  1. Add an Interpolate Hair Curves node, selecting the right Object and the correct UVMap), and not clicking Surface Rest Position.

  2. Add whatever other Hair Modifiers you want under the Interpolate Hair Curves Modifier.

  3. Next comes the Surface Deform Modifier.

  4. Add an Attach Hair Curves to Surface Modifier after the Surface Deform Modifier, select the correct object and UV Map and do not click Surface Rest Position.

This seems to work and I believe it will work when I get to rigging. What do you think of this setup?

Joe.

As long as mesh is not animated ; you can not just trust the shape you are seeing.

In theory, if Surface Rest Position is not enabled for Interpolate Hair Curve node ; that should not work. Result should be hair guides sliding on surface, during movement.
A valid explanation would be that, this modifier is disabled or that a Generate Hair Curves modifier is making it totally useless.

But I don’t see another one to explain, that such set-up would not fail when it is animated.

If you encounter an issue, later ; you will know what to try.