[v2.7x] Avoid circular dependency in hair rig

Hey,

So as part of some utils I’m building, I put together some scripts for managing groups of softbodies, basically it’s just a single panel that lets you generate/edit multiple cloth modifiers.

Now the way the setup works is I take a chain of bones and generate some basic geometry around it, apply softbody physics to that geometry, then vertex-parent empties so that they land exactly where the end of the bone would be in resting pose; the chain is then driven by those empties.

All of this is one-click – easy money.

So on to the actual problem: this works as intended but it creates a dependency cycle as I have to parent or constraint the ‘controller’ mesh to the armature in order to sync origins, which means the console won’t shut up about it. What are the options here?

And of course I can just do the parenting manually through python and the error message would go away, but that doesn’t negate the error being there. So what I’m thinking is probably I need to do away with parenting, but then how do I sync deforms from the armature to the controller?

This sync is needed in cases where the bone chain is parented to some anchor, like the head of a character in a hair rig, for instance; when the head moves the controller needs to react to this.

Any ideas? I’ve been scratching my head with this silly thing for a couple of days and I can’t think of a solution.