Feature Request: Hair Rigging Tools

Issue #858 resolved
Midnight Arrow created an issue

I’m developing a workflow to rig hair cards with bendy bones, to eliminate the need to import hundreds of megabytes' worth of vendor morphs and give myself more precision over how hair is posed. Since bendy bones are spline-based, this workflow offers great results with relatively few bones per “lock” of hair, but it also requires a lot of tedious juggling of vertex groups, visibility, and selections. I cobbled together some scripts to help me, but I have no prior experience coding in Blender, so I would like to explore whether this workflow is something that can be directly integrated into the importer.

My workflow relies on using brush/circle select, along with the Select Linked operators, to isolate locks of hair moving in the same direction, storing them inside vertex groups that can be isolated with a mask modifier, and creating a bendy bone chain following the strands:

https://www.youtube.com/watch?v=tpUXoAK6lr8

Since bendy bones are splines, the weight painting is very quick and easy. Once it’s finished, adding a Smooth Corrective to ease out any remaining jagged edges produces nice, flowing curves.

I can elaborate more on my workflow and its caveats and gotchas if you feel this is an avenue worth going down.

Comments (12)

  1. Thomas Larsson repo owner

    Having a better way to animate or simulate mesh hair would be very welcome. I have tried various tricks in the past, e.g. adding a low-poly “cap” and deforming the high-poly hair with a surface deform modifier. This can work in some situations, but not at all in others, e.g. if the character is hanging upside-down. Bones which mimic the hair strands should work much better.

    A big problem is how to automatically locate the hair bones. When we added softbody simulations in #828, the softbody objects could be located because they are only added to genesis characters, and the plugin knows about the genesis meshes. We cannot do anything similar here since each hair mesh is unique. Perhaps we could use uv information as is done when making particle hair, but hair bones should probably be distributed much more sparsely than the hair guides, and getting a good distrubution seems difficult.

  2. Midnight Arrow reporter

    I doubt it’s possible to completely automate it short of writing complicated algorithms to scan for similar curves and distance between them.

    However, one way to make it as efficient as possible would be to manually isolate a number of strands flowing in the same direction, select the long edge of the centermost one, and run an operator to procedurally create a bendy bone chain based on the selected edge’s vertex normals while also weight-painting it. The weight painting doesn’t even need to be that good since the curve will naturally iron out most deformations. In fact if you create a bendy bone with only one segment you can just paint the whole strand red. The root handle will keep the top edge in place on the scalp.

  3. Alessandro Padovani

    This sounds similar to ik goals and winders in the advanced rigging section. If the user can select a group of hair strands he needs to be “rigged“ then the tool could add the bendy bones. Then manually selecting all the hair strands in groups for a whole hair wig may be weird to do. But the user may need only some of the strands to be animated this way.

  4. Midnight Arrow reporter

    I disagree that it’s weird. With bendy bones and the circle select tool you can easily pose a character’s hair every time they tilt their head without having to import hundreds of megabytes of vendor morphs or wait hours for a hair sim to bake:

  5. Thomas Larsson repo owner

    There are two separate steps here.

    1. Identify the locks and set up bones and vertex groups. That probably involves a considerable amount of manual work.
    2. Set up the bendy bones once that is done. This should be possible to automate.

    Some hair assets are already rigged with a lot of bones. In such cases it may be possible to use those hair rigs as a starting point. And perhaps add some kind of simulation too.

  6. Alessandro Padovani

    @M.A. Sorry I tend to be harsh in my comments but you can trust me to always try to be constructive. Also I like your ideas and I hope they can improve the plugin to some degree. As for what’s “weird“ to me it is what I see in your example. I’d never have the patience myself to setup and pose such a lot of bendy bones by hand in a hair wig. But I understand I’m a “rush“ guy and others may be more dedicated.

  7. Midnight Arrow reporter

    Actually if you use the circle select tool you can select dozens of handles at once and move and rotate them all in a matter of seconds. Posing hair like that only takes a minute. A little more if you spend time fixing pokethrough and re-arranging strands but not much.

    It does take a long time to setup but for sequential art where you use the same figures a lot it’s very much worth it.

  8. jeroen b

    What I would do if simulation baking time is a concern, is to duplicate the hair, delete most of the geometry and only keep some key strands that will collide and probably a few more. Then simulate this sparse mesh and transfer the motion to the actual hair with the surface deform modifier.

  9. Alessandro Padovani

    @Thomas Due to the latest commits, you may want to consider this too, that’s using bendy bones instead of normal ones. Then if @Midnight has nothing to add we may mark as resolved since the basic functionality is there.

    As a personal note auto-ik can also be used in blender instead of ik effectors or winders.

  10. Thomas Larsson repo owner

    I added an Auto IK option and made it the default. I will look into bendy bones later, but it was a long time since I played with them and don’t remember exactly how they work. It would be good if you left this issue open so I can come back and look at what Midnight had to say.

  11. Log in to comment