Closed andybak closed 5 months ago
here's the existing logic:
static getPreferredFormat = (asset) => {
let types = {}
for (const newformat of asset.formats) {
types[newformat.format] = newformat
}
if(types.hasOwnProperty("GLTF2")) {
return types["GLTF2"]
}
if(types.hasOwnProperty("GLTF")) {
return types["GLTF"]
}
if(types.hasOwnProperty("TILT")) {
return types["TILT"]
}
return null
}
}
So I think it just checks "formats" for an entry of type GLTF2 first. If it's there it uses the new loader. If not it assumes it's the old format.
Here's a good example to test it's working: /view/kevo/y7m0Evyso48/
me too
Either
await viewer.loadGltf("foo.gltf", true);
or
await viewer.loadGltf1("foo.gltf");
We currently always seem to do the first one but we should be detecting GLTF1 files and using the second.