Ok. Back again. If you look at the project n defold-tools called GLTF Lua Loader the method that sets the mesh data is called: geom:makeMesh
In this a couple of key methods from the extension are used:
Lines 34->36 of geometry-utils.lua:
geomextension.setbufferbytesfromtable( meshbuf, "position", indices, verts )
if(normals) then geomextension.setbufferbytesfromtable( meshbuf, "normal", indices, normals ) end
if(uvs) then geomextension.setbufferbytesfromtable( meshbuf, "texcoord0", indices, uvs ) end
As can be seen this sets the meshbuffers position indexes, normals and texcoord. You can also set verts. In file gltfloader.lua line 169:
geomextension.setbufferfloatsfromtable(bv.byteOffset or 0, bv.byteLength or 0, buffer.data, gltf.verts)
In the geomextensions there are a number of helper functions for this. Iāll make geomextensions a proper extensions repo so people can just include the lib in Defold projects - will look at this on the weekend.
All the best everyone (and yes, Im getting back into Defold after a crazy time in gamesā¦ our whole studio got erm ālet goā. ā¦ cant say anymore).