View Full Version : Bullet dynamics hair problem

05-07-2017, 03:54 AM
I keep having a problem with bullet dynamics on my guides for a hair mesh. It's worked fine before on other models.
I have a head that is imported into my scene via fbx, with a head and neck bone plus motion is recorded to this head. Next I imported my hair mesh/guides and patented it to the head bone so it tracks with the head.
Next I add bullet dynamics and start the sim.
(Oh forgot to mention the hair guides have a weight map on them)
All begins OK until I reach a certain point where the simulation begins to slow down and almost freeze, then suddenly the guides explode everywhere and everything pretty much locks up for a few minutes.
Anyone have any idea of what the problem could be?

05-08-2017, 01:10 AM
That's sounds pretty weird.

Are you using self-collision on the guides? That could get computationally intensive and, in my experience, it may not be needed for most animations. I don't think I've had that 'explode' on me but that may depend on how you've styled your hair guides.

How are you applying the weight map? I use it in Mesh Filter but that only pins the root points and doesn't have fall-off, so I also use it Shape Retention where I can use it with a gradient. This makes the hair very stable near the scalp and the gradient makes it gradually 'looser' towards the ends. That's not necessarily 'realistic' but it can look really good in most situations and it calculates very quickly. For me, it's typically only a few minutes for several hundred frames. (I don't have time for anything slower than that.)

Another thing to consider is how your using head and shoulder collision with the guides. I try to keep the setup simple by using a 'head-only' mesh parented to the head bone, and using Kinematic. Typically, I do this in a separate 'calc' scene, and write out an .mdd for the final scene with the full rig. Don't use Deforming on the full mesh--that will be too slow and you really won't gain much for all the extra calc time. And if the guides get 'pinched' in the deforming Bullet collision objects, that could cause them to 'explode' as you described. With Kinematic, that's less likely to happen (unless they're getting pinched between the head collision object and any shoulder collision object you might have.)

I don't know if any of that will solve your problem but maybe it will give you some ideas for what to look for. Good luck.