GLB Import: Mesh indices == 0

Hey guys!

So I found this standard Fox GLB model (from KhronosGroup GLTF repo) with a mesh that has totalIndices() == 0, even though totalVertices() == 1k+
Here’s the PG

This can lead to several issues with custom skeleton + skinning code

Adding @bghgary

This is correct because this glTF model doesn’t provide indices. When this happens for triangles, the vertex positions are read in order (0,1,2), (3,4,5), etc.

What kind of skinning issues are you having?

Hmm that’s interesting

I was planning to add arbitrary bones and then run a skinning algo to bind the bones to the vertices.
I think the assumption that if indices == 0, using the default order (0,1,2), (3,4,5) etc is a good one. Question is, do you think BJS should auto generate this assumption so that getIndices() returns this info by default, or is it something that devs like myself should assume

If we automatically calculate this, then we need another way to figure out if the mesh actually has indices or not. @Deltakosh @sebavan @RaananW Any thoughts?

If a mesh has no indices then getIndices() should return nothing like now. We can always add a generateAutomaticIndices() maybe?

yea that would be a neat function to have, probably not gonna be used a lot but handy in the right cases, like this one :slight_smile: