How to read blob uri? #847
Answered
by
donmccurdy
neciszhang
asked this question in
Q&A
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
donmccurdy
Mar 9, 2023
Replies: 1 comment 1 reply
-
Is this a .glb file? If you have a File instance already, then accessing it through an ArrayBuffer and parsing that might be the way to go: const arrayBuffer = await file.arrayBuffer();
const { json, resources } = io.binaryToJSON(arrayBuffer); If it's a .gltf and already in local memory, then you'll have to construct the JSONDocument yourself in order to parse that. Relative references to textures and .bin files will not work when encoding a blob URI. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
neciszhang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this a .glb file? If you have a File instance already, then accessing it through an ArrayBuffer and parsing that might be the way to go:
If it's a .gltf and already in local memory, then you'll have to construct the JSONDocument yourself in order to parse that. Relative references to textures and .bin files will not work when encoding a blob URI.