I have a .glb file that I’ve exported from blender using the kronos gltf exporter 2.0. When I import it into threejs, I can’t find the vertex groups. Am I just being blind or are they not being exported properly. File attached. Thanks for the help!
race8.glb (3.9 MB)
The vertex groups aren’t in the file, no. From the JSON…
… you can see that there’s only one mesh, and only one primitive in that mesh. The vertex groups would be separate primitives if they were there. I think the Blender exporter may only write the vertex groups if they’re needed to have multiple materials or something.
The vertex groups are not necessary for skinned animation after export. However, note that this file has too many joint influences per vertex — because there are JOINTS_0–3 attributes, that means this file uses 13-16 influences and most engines support only 4. There’s a setting in Blender you can use to reduce that automatically: https://blender.stackexchange.com/a/14252/43930. That would fix the animation issues you see, I think.
My goal is to parent an object to vertex groups but I might be misunderstand how things work. For example, I have gloves that I need to map to a hand, so if I deform the hand, the glove will track the fingers. How do you have one object map to multiple bones for more complicated animations. Thank you for the feedback btw
You won’t be able to parent objects to vertex groups no, they’re all part of the same object in the node hierarchy. But you can parent an object to a bone (for example, at the wrist) and get the same result.
Or at least that’s what you’d do for a prop held in the hand… for a glove it will need to have joint weights exported with it, and you probably won’t parent it to anything. Just move the armature to move the meshes associated with it. I’m not sure how exactly to set that up in Blender though, it may be tricky: https://github.com/KhronosGroup/glTF-Blender-Exporter/issues/232
So I just want to clarify because this seems a little bit like magic. If I parent the glove to the wrist bone, the glove mesh should deform based on how bones further down the tree from the wrist move?