I’ve faced with strange issue when vertices of skinned mesh viewed in threejs not same as in blender (see attached pic below). It seems that only vertices that positioned in the middle of mesh have this issue somehow (while other vertices are fine). I’ve used mirror modifier in blender for creation as well as weight painting and problem I’ve noticed always with vertices that positioned exact between mirror sides and no where else. Skeleton has bones marked as .R and .L accordingly. I wonder why it’s happened ? I think the problem can be due to on same vertices there are influences both from .R and .L bones as well as straight bone in middle btw .L and .R, but why in blender its view is fine and threejs is not. May be there is a way to check resulting weight for each bone in threejs and compare it with blender ?
Here is my uneducated guess:
- Three.js supports maximum of 4 bones per vertex
- Blender, most likely, can support more bones
So, check whether these specific vertices are bound to more than 4 bones. If this is the case, I’d expect that Three.js will use only 4 of them. I’m not sure whether it will pick the 4 biggest weights, or the first 4 weights.
But this is just a guess. I have epsilon experience with Blender.
Interesting, thanks for this info! I didn’t know about that restrictions/feature. Need to dig it because in blender I can see more than 4 bones per vertex used…
For now I only was able to make one of these wrong weighted vertices (lower circled one into red on picture) to place correct in space copying weight values of .L and .R of neighbour vertex that positioned well (may be good result of this is just coincidence)… but same trick didn’t work for upper vertex circled on picture… it showed too high or too low in threejs depending on weight values I’ve copied from neighbours and I don’t know why… may be it is due to limitation of 4 bone per vertex and feature of an algorithm to choose which one to use… will dig it.
UPD It seems you are right. I’ve played with vertex I was able to position on correct place (lower circled in picture) and changed weight values that was changed previously (I have 6 bones weighted on vertex) in several ways: 1) make weights or L/R lowest by 0.00001 in respect of others weights that makes these L/R pair go out of max weighted 4 bones - result was correct 2) make same weight with lowest one - result was with issue painted above… Thanks once again for this hint!! Now I wonder how to solve my problem with more than 4 bone per vertex weighted (((… I saw on this forum info when more than 4 bones used in vertex weights but need to check performance issue in this case…
Maybe there is some option in Blender to restrict the binding to 4 bones max or at least to show which vertices violate this limit?
Yes, you are right. There is in weight mode Weights → Limit Total → subset set to ‘Deform pose bones’ and now it looks like in threejs with all same issues :)…