BJS GLTF importer has a major bug when it comes to importing this GLB (here is the .gltf and .bin file for reference).
The skins/skeletons fail to be imported into the scene. I believe this is because the skins/skeletons import section assumes that the order of the nodes are from parent to child. But in this GLTF file, some of the childs are ordered before their parents in ‘nodes’ e.g. mixamorig:HeadTop_End is in nodes index = 0 while RootNode/Hips are in index 15 and 16.
If according to the spec the file should not be displayed correctly, then Blender is bugged if it displays it correctly.
Note that I don’t know if it’s the case, but because there are some errors in this file and because 3 viewers can’t display it properly I would lean toward a mis-behaving on Blender side.
Note also that if you open the file in Blender, save it to glb then open this glb file in the sandbox (and in the other viewers), it does work.
“Note also that if you open the file in Blender, save it to glb then open this glb file in the sandbox (and in the other viewers), it does work.” - Yep, Blender is awesome that way
I think when we last looked we where able to find blenders parsing stuff @mrlooi, maybe it would be possible to convert it and polyfill over the generic BJS parsing stuff with whatever blender is doing then the two would behave similarly. I just think we looked into this already and it was quite the project.
Yea probably, tho Blender’s codebase is quite the monster to say the least haha. And porting all those from blender python to JS to BJS internals is quiteee the port
As The Blender importer / exporter pair is the only one directly supported by the Khronos Group, GitHub - KhronosGroup/glTF-Blender-IO: Blender glTF 2.0 importer and exporter, perhaps they put in stuff that fixes this problem, helped by the Blender API which does not even specify a parent bone when instancing a new bone
Actually that is kinda what they are already doing with the animation parsing if I’m not mistaken (still using that method @mrlooi from when I was with yall?). Could possibly recycling that code and modify it a hair to do a second pass like blender does to fix whichever problems.
Yea possibly, it’s a bit different (that’s more for merging duplicate skeletons) but yea in principle some of the logic is the same : P
The main issue is that importing a GLB with empty nodes invalidates the entire BJS importer skeletons/skinned meshes, which is obv not what Blender does
As The Blender importer / exporter pair is the only one directly supported by the Khronos Group
Interesting, no wonder their GLTF support is so good
This GLB contains meshes that are not referenced by the scene. All that needs to happen is to add the skinned mesh nodes to the scene and then it will load properly.
"scenes": [
{
"nodes": [
15,
68, // add this
69 // and this
]
}
],
If Blender is loading all of the nodes regardless of what the scene says, that is technically also correct, but it’s not the typical behavior of viewers.
Here is updated glTF files with the scene fix: capoeira1.zip (1.1 MB)