Make Bone Copy Position of Vertex

Hello!
I’ve been working on an animated model of a dog that will be exported to unity. I have been trying to create a bone that follows the position of a specific vertex on the dog’s collar, so that this bone can be the parent to a model of the dog’s tag.

My problem:
The vertex that I’m trying to get the bone to follow does not have a weight of 1 to the dog’s neck, but rather has weight distributed between its neck, head, and scapula, which has proven to be very difficult to get a bone to follow.

What I’ve tried:
-I’ve tried directly parenting the bone to the vertex, but since the mesh is already a child of the armature, this resulted in a cyclic dependency error.

-I have created an empty and parented that to the vertex, and this works flawlessly. However, the animation of the empty does not export to unity without manually baking the the empty’s movement for each animation of the dog, which is impractical because I will be creating many animations for the dog and this is a lot of manual work.

-I have tried parenting the bone to the previously mentioned empty, which creates a weird jitter effect since this is really only a loophole around the cyclic dependency and not a solution to it.

-I have tried giving the bone “Child of” constraints, and copying the exact weights that the vertex has for the four bones that its weight is distributed to. This gave good results when the dog wasn’t in extreme positions, but for some reason would become less and less accurate as the dog deviated more from its default pose.

This seemed like such a simple problem at first, but I am stumped and can’t find a solution. I’d appreciate any input!

I haven’t done this myself, and I’m looking forward to reading the better answers, but I have a couple of ideas, dunno if they might be useful.

  1. Presumably the pendant or whatever is solidly weighted. Could you just separate it to a different object, and its bone to a different armature, to eliminate the loop?

  2. Weights are kind of evaluated all-at-once while constraints are sequential, so if it is possible to simulate 4 bones via child-of constraints, it’s not going to be obvious, and the numbers aren’t going to be the same as the weights. For example, to simulate 2 equal weights, you’d give influences of 1 and 0.5, not 0.5 and 0.5.

I tried to work out the math, but I think I got something wrong, and I don’t know enough about deformation algorithms to know if the concept is even sound.

Hi ItalianJoy ! Hah ! The good old bone-follow-mesh problem. I am in the process writing a post to Right-Click Select about this exact thing. :slight_smile:
It can be solved by parenting a different armature (I mean parenting the entire armature in object mode) to the vertex (or three vertices, which will give it an orientation as well as a position, can be useful) and rigging the tag with that new armature. However not sure how that will export to unity. With the new dependency graph, this kind of relationship should be possible. It’s not really a cycle because that particular bone does not influence the mesh it’s driven by - it’s supposed to influence another object… but legacy DG doesn’t know that.

I appreciate the responses!
@bandages

  1. I tried this and it worked perfectly in Blender! However when exporting to Unity, it is an extremely tedious process to get the animation to work. You must export the tag animation completely separately from the dog’s animation, then you must give it its own avatar and animator, which means you would have to sync up every single animation in Unity between the dog and its tag which definitely cannot be the best workflow to accomplish this.
  2. I did not consider this, but it’s a good point. I tried to play with it more to figure out how to get the right result, but like you said, it’s not obvious at all. However, if we were able to figure this out, it would be a perfect solution because it keeps the whole animation inside one rig.

@Hadriscus
I appreciate the idea! And this works well in Blender, but like I’ve just detailed in response to @bandages, this is extremely tedious and manual to import into Unity.

If anyone else has ideas, please share them!

My idea is to start a proper rigging wishlist, complete with reasoning and pictures and designs, because animation and rigging workflow is going one of the next projects they work at the institute

Hadrien

For anyone who has this same problem in the future, my solution was the following:

Each different dog tag object was merged with the dog model, so now there are several overlapping tag meshes which are a part of the dog model. Each tag is given a different material. The weight of each of the vertices in the tag is identical to the weight of the specific vertex on the collar that I was originally trying to get the bone to follow.

After exporting this to Unity, every material except for one is disabled from rendering, and in this way you can switch between which tag is seen which is essentially the same as swapping out separate models following a bone.

Hope someone finds this helpful, and thank you to those that offered help!

Clever ! Merging meshes is not always an option but glad it worked out for you !