I have imported a pre-existing, fully-rigged model into Blender 2.79b. Unfortunately, the source model contains some bones that Blender doesn't appear to know how to import correctly, and thus drops them entirely. (I can recreate the bones correctly afterward, that part's not a big deal.) As a result, about 10%-15% of the mesh contains vertices with missing vertex weights. (I can't control the original model, I'm stuck with how it is.)
However, I know that all vertices must have exactly 1 or 2 vertex groups, and their weights are correctly set to sum to 1.0. I also know that the missing groups do not overlap. Therefore, I could go through every vertex near the bone in question and check its groups:
- If the vertex has no groups, it must have a weight of 1.0 in a missing group.
- If the vertex has 1 group that's less than 1.0, it must belong in a missing group with a corresponding weight (e.g. if it's already in "shoulder_R" with weight 0.35, then it must also be in "arm_R" with weight 0.65).
I could do this manually, but that's a lot of work with lots of potential for messing up.
Is there a way to automatically assign a bunch of vertices to a vertex group that "fills in" their total weights to 1.0?
I tried a few things with weight painting but I didn't find anything that seemed to be what I was looking for. I'm not averse to scripting but have no experience with it.