GLTF post processed types
I couldn't find any corresponding types if you load a gltf file with postProcess: true.
const gltf = await load(url, GLTFLoader, {
DracoLoader,
gltf: { postProcess: true },
});
A Node will have the mesh typed as number, for examaple:
{
id: "node-0"
mesh: {name: 'mesh-name', primitives: Array(1), id: 'mesh-0'} // mesh will be typed `number`
…
}
It looks like you output is from console.log. primitives: Array(1) should contain a primitive with a number of attributes where the geometry is stored.
@dionysiusmarquis Updating loaders.gl to TypeScript has been a truly epic task and you have found a corner we didn't yet get around to. We should address it. I will assign a 3.2 milestone to this, which is likely too optimistic unless someone contributes, but at least a declaration of intent.
An update for those piecing this together like myself, please correct me if I'm mistaken.
It seems that the current npm release (3.1.8) has a WIP version of gltf-postprocessed-schema.ts. The most recent version in the repo is more complete, but still WIP, ie bufferView properties are currently still GlTfId:
/src/lib/types/gltf-postprocessed-schema.ts
For now I'm copying pasting this into my projects.
The particular typing of mesh has been fixed: https://github.com/visgl/loaders.gl/blob/f030d39d5cdedb137e43e757a9da10dd637857fd/modules/gltf/src/lib/types/gltf-postprocessed-schema.ts#L518
I've done it down the road. There are other objects that should have another type other then GlTfId.
By the way 3.2.0 has been just published and typing for mesh object is there.
@ibgreen shall we close it or move to the next official release milestone?
Moved it to backlog
In v4.0, postProcessing is broken out from the glTF loader and the output of postProcessGLTF should be fully typed