So I am back after a timeout in programming and slowly continue programming:
Weights now are created for assets also (or use a given weights-file like our standard shoes). Animation and pose now use the weights inside makehuman2 instead of the barycentric approximation method (originated in makeclothes).
I already continued to put them into glTF exporter. So for testing: Do not call the export with a skeleton selected except you want to be suprised ... yes they already somehow do something in Blender:
- our new standard mesh :)
Meshes with deleted/hidden vertices will create problems, because the weights are not yet attached to the correct vertices of the "shortened" meshes.
And meshes using a different skeleton need to recalculate weights ... this is also not yet added,
The guy in the image uses a bunch of inverse bind matrices, which are not calculated yet (atm. I use the identity matrix before I start using my brain how to calculates these). And it uses only 4 weights per vertex as a maximum at the moment ... which is NOT the limit as I learnt in between.
About the limit of weights: glTF has the values WEIGHTS_0 and (keys) JOINTS_0 for the first 4 for weights, It would be WEIGHTS_1 and JOINTS_1 for the next 4. This can go up to 9 which means a maximum of 40 weights.
These values are packed into a VEC4 arrays of float32, so that the glTF file can be used as direct input for the graphics card.
I still use 4. 8 should be okay in the end. Maybe I can add a limiter in the menu, if you want 4, 8 or more. I remember Godot complained, but cannot remember if it was 4 or 8.
Anyway I hope I am able to fix the matrices and the deleted vertices problem first.
The leaf-bones in glTF will also not always show the correct direction/length for each bone (same problem when you import an FBX in Blender etc.). Try to export a glTF file with skeleton and do an import in Blender.
But when that is working correctly, the export for a game engine should always work.
The blender exporter will use a different technology for the bones and weights. We know bone-head and bone-tail inside makehuman, so I will re-export it correctly. Same goes for the weights, which are variable then.
Greetings
punkduck