Closed elalish closed 1 year ago
Okay, actually I think the problem is that this file is Draco compressed and I failed to register the dependencies after installing the extensions. So we can either close this or maybe write a clearer error message 😄. I found your answer here, though I'm struggling to convert that into TS-style - ideally I would just lazy-load the decoder somehow, though I'm not even sure their package is a module.
One related question: If I read a draco-compressed file and then write it out again, will it write it with the same compression settings as it came in with?
Okay, well considering your fix, I guess it was two things. Thanks!
I do wish Draco were packaged differently. You'll need to modify it by hand to import as a module, I think.
If I read a draco-compressed file and then write it out again, will it write it with the same compression settings as it came in with?
I don't think I have access to the original compression settings, and the original bitstream cannot be reused here, so it'll export with default compression. To avoid that, on the CLI I'll log a warning like...
Decoded {extensionName}. Further compression will be lossy.
... and then output the model uncompressed, unless the user re-applies compression themselves. Trying to avoid repeatedly applying lossy compression to the same file.
Ah, that's good to know - I probably shouldn't bother supporting auto-converting Draco-compressed files anyway then. I'll find some way to log a warning instead.
Describe the bug During debug of https://github.com/google/model-viewer/discussions/4227, it looks like gltf-transform fails to load the attached file when its URL has been converted into a Blob, due to
detectFormat
returning that it's a GLTF, followed by a failure to parse the binary as JSON.To Reproduce Steps to reproduce the behavior:
Expected behavior A Blob URL should parse like any other.
Versions: