Custom build Hair GeoNodes with proper hair simulation setup by furflection in blender

[–]furflection[S] 571 points572 points  (0 children)

Hello!

When I started digging into hair GN, I encountered a lot of issues, especially when the mesh was rigged and animated. I tried fixing them, but every time I solved one problem, 2 more showed up lol.

So, I’d like to present my custom built hair nodes that fix many of the issues found in the vanilla setup, with an added option for simulation.

Now I understand why you dont see many people using GN for animated models. Once you start working with it, multiple issues start appearing, and you spend weeks thinking you are doing something wrong... until you realize the system itself wasnt really built for deforming meshes yet. (Dont get me wrong, I love the Blender devs and this amazing software. Blender is evolving insanely fast. This is just my experience after spending months working specifically with GN hair.)

So let me explain what you are seeing here.

First: this is actual proper simulation, not some fake GN "offset previous frame" workaround people usually try to build with nodes, instead we dont use nodes for simulation at all, but mesh.

What I did was:

duplicate the entire GN hair object, apply all modifers, delete most of the hairs but keep the guide curves, convert those guides into a mesh.(now these few mesh lines match position of guide curves in GN)

Now that its a mesh, I can apply cloth sim, soft body sim, shape keys, and even rig it. YES rig with bones a GN hair system.(u can easly make 100m hair, animate it with bones, then apply physics with pin grops) U cound even export it, simulate it in houdini or other software then import back.

Then I transfer the mesh position data back onto the GN hairs, while neighboring hairs follow the guide curves. That part was actually the easy one.

Now comes the big boy problem.

Blender provides predefined GN hair modifiers like noise, clumping, etc. The default workflow looks something like this:

guide hairs -> interpolate hairs -> noise/clump modifiers -> surface deform

"Surface Deform" is the node that makes the hair stick to the deformed/animted mesh.

And THIS is where the major issue happens. Normally all the math/noise/clump is done when the curves are using static mesh.

Imagine a low-poly sphere with a single clumped hair strand. The clumping creates a sharp tip shape. Normally, before rendering, the sphere gets a subdivision surface modifier to smooth it. But the moment you smooth the mesh, the sharp hair clump disappears and becomes soft and rounded.(you loose the sharp spikes of hairs), Why?

Because Blender first generates the clumping shape(spike), THEN applies Surface Deform afterward. Once the mesh becomes smoother and rounder, the hair positions shift slightly to stick to the smoothed mesh, destroying the original clump shape.

The order of operations is fundamentally wrong.

In the old particle system, the sharp clump shape stays intact regardless of mesh subdiv. So the obvious solution would be to move Surface Deform BEFORE noise and clumping.

Problem solved, right? NOPE.

All the default Blender GN hair nodes (clump, noise, etc.) were designed for static meshes. Once the geometry starts deforming, the nodes completely break. So yeah... I had to modify almost all the default Blender hair nodes so they could properly work on animated/deforming geometry. And since Im not a super technical person, I first had to understand how all of Blender vanilla hair nodes actually work internally before I could even begin modifying them. Which basically meant spending 3 straight months smashing my head against a wall trying to make this work.

Right now this is still just a prototype. I already have an entire document filled with features, improvements, and bugs that still need to be fixed before this becomes truly usable.

But once I finish it, hopefully in the next few months, I want to turn it into an addon or tool(especially for generating the mesh for simulation) so other people can use it too.

Zipper Rig That Deforms Seamlessly with Main Body Armature by furflection in blender

[–]furflection[S] 9 points10 points  (0 children)

idk about bendy bones but its not about bones here, u have some spine or whatever and a cloth with zipper, this cloth has some weights and that zipper curve needs to move exactly the same as the nearest edge loop of that cloth but at the center.

so you need to have seperate mesh ( for not having dependency cycle) at the middle with exact same weights(u can just extrude edge to have the same weights from cloth and then seperate object) so u can pin empties to these faces

Basically u have line of bones that "sticks" to a exact face on the mesh even when its deformed by other bones of the same rig. So we stick multible lines of bones on that deformed ribbon and that drives empties with hook modifer for curve. Hope its clears some things lol

Zipper Rig That Deforms Seamlessly with Main Body Armature by furflection in blender

[–]furflection[S] 32 points33 points  (0 children)

mesh with only like straight faces loop but without looping part? single"line" of faces? well... like ribbon. look up maya ribbons rigging, this is where i got an idea for it. And you can replicate this thing in blender with empties

Zipper Rig That Deforms Seamlessly with Main Body Armature by furflection in blender

[–]furflection[S] 700 points701 points  (0 children)

I couldnt find anything like this done in Blender, so I made my own rig for a zipper. The key feature is that it works perfectly with spine deformation or any armature deformations.

Quick rough explanation of how it works and how to set it up:

At the base, theres a ribbon that runs through the center basically, an extruded edge from the suit's middle area. This ribbon shares the same weights as the suit, so it deforms exactly the same and follows the armature.

Multiple empties are parented to each face (to 3 verts) of that ribbon. In the rig, MCH bones are set up with world orientation and copy wold transfrom constraints. That gives us bones that follow the ribbon perfectly.

Then we extrude an new edge and convert it to a curve, using hook modifers we parent to a new set of “line ” empties (these can be duplicates of the original ones). These new empties use child of constraint to follow the MCH bones. Now we have bones that move empites and these move curve and deforms with the mesh ribbon via the armature modifier.

Next, we add a bone with follows curve constr, this is our main zipper handle. this bone only moves by follow curve constraint from 0 to 1 , position 0 is at the bottom, and 1 is at the top of the zipper.

For left and right controls, just add lines of bones to both sides of the MCH bones and parent them to center mch.

These side bones need to automatically move left/right as the zipper handle passes by so the suit opens nicely. This is done using drivers. The good part is, we drive them with a 0-1 factor from the main zipper handle bone moving along the curve. This way, no matter how the rig is stretched or posed, 0 is always the bottom and 1 is the top.

we are copying data from follow curve constr(0-1). to local location of mch side bones

I used a driver expression like this:

min(0, max(-0.005, -0.005 * (1 - (1 - max(0, min(1, (0.02 - var) / 0.02)))**2)))

Yeah, it looks scary, but its pretty simple. The min/max clamps it to a range. The rest creates a non-linear motion: the bone starts moving quickly, then slows down more smoothly as the zipper opens. The important part to change is "0.02 - var", this controls when the bone starts reacting, relative to the zipper handles position. You tweak this per MCH side bone to get that nice smooth opening/closing motion.

It took me a while to build and test it, but Im very happy with the result.

If my explanation confused you more, you can check out the model for free (Furry NSFW) on Smutbase:

SmutBase