Open Wildenhaus opened 2 years ago
I did an experiment to see if I could fix the bones only to be more baffled by what came next.
The minigun's base and gun are a single mesh. The SkinCompound has weights that are applied to the vertices of the mesh. After applying them and importing, it appears that both the gun and the base are weighted to the gun bone. Then, there are loose, overlapping vertices that are weighted to the base bone.
Screenshot (i moved the loose vertices to the side)
Really not sure what Saber is doing here. My only guess is that these loose vertices are supposed to serve as some sort of anchor point or replacement for the other vertices.
But that guess brings up another issue. The loose, overlapping vertices don't encompass the entire base - the top part isn't there. So even if those overlapping verts served as a replacement, the top portion of the base would still be parented to the gun bone.
It's very possible that weights just aren't being applied right, but the loose vertices thing isn't exclusive to this model. We'll have to figure out what's going on with those.
Point of interest: looks like splitindex is identical to the object id?S3DObject
-> GeomData
-> SplitIndex/NumSplits
Bones/weighting is broken for minigun__h and probably a handful of other places too
The object hierarchy is like so
The issue here seems to be due to the way we're resolving bones in
ConvertModelToAssimpSceneProcess::ApplySkinCompoundData()
.In this case, the issue is with
_b_base
and_b_gun
. The skin compound's "Bone IDs" point to_minigun_base
and_minigun_destroyed_$p1
, and then later on we're resolving both of those objects to the_b_gun
bone, so everything gets parented to that with a weight of 1.I suspect that the bone ids in the skin compound aren't actually bone ids, but either mesh ids or the index of the bone within the hierarchy.