Error reading glb file #366
-
Hi! I'm trying to read glb file with NodeIO read but I keep getting an error: thanks for any info. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
https://gltf-transform.donmccurdy.com/classes/extensions.dracomeshcompression.html#example import { NodeIO } from '@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions';
import draco3d from 'draco3dgltf';
// ...
const io = new NodeIO()
.registerExtensions(KHRONOS_EXTENSIONS)
.registerDependencies({
'draco3d.decoder': await draco3d.createDecoderModule(), // Optional.
'draco3d.encoder': await draco3d.createEncoderModule(), // Optional.
}); I had thought that NodeIO gave a clearer error when this dependency was missing though... will take a look at that. |
Beta Was this translation helpful? Give feedback.
-
Hi Don!
Thank you for your reply. I’ve tried to implement it both in node and front end but keep getting the same error:
Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -s ASSERTIONS=1 for more info.
Any ideas?
Thanks
Lucas
… On 28 Sep 2021, at 16:49, Don McCurdy ***@***.***> wrote:
DT_FLOAT32 is a Draco constant, it sounds like the file you're trying to load might require Draco decompression? If so, you'd need to use the draco3dgltf npm package and register it as shown here:
https://gltf-transform.donmccurdy.com/classes/extensions.dracomeshcompression.html#example <https://gltf-transform.donmccurdy.com/classes/extensions.dracomeshcompression.html#example>
import { NodeIO } from ***@***.***/core';
import { KHRONOS_EXTENSIONS } from ***@***.***/extensions';
import draco3d from 'draco3dgltf';
// ...
const io = new NodeIO()
.registerExtensions(KHRONOS_EXTENSIONS)
.registerDependencies({
'draco3d.decoder': await draco3d.createDecoderModule(), // Optional.
'draco3d.encoder': await draco3d.createEncoderModule(), // Optional.
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#366 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMWCBSCMGILHH46LM5FUR5DUEHIX3ANCNFSM5E5QFOFQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Hi!
What I'm trying to run it on is electron app with react as UI. As I'm quite new to electron development I'm not sure whether electron's main process is classed as node environment or the whole setup is classed as front end since it's running in Chrome.
I've still got few ideas that I want to try, but if that clears the issue for you and you've got some suggestions I'd be extremely grateful.
Regards
Lucas
Sent from BlueMail
…On 29 Sep 2021, 18:38, at 18:38, Don McCurdy ***@***.***> wrote:
The `draco3dgltf` package will only work in Node.js I think. For use on
the frontend see [this
answer](https://stackoverflow.com/a/66979159/1314762). Unfortunately I
can't tell much from that error, can you share enough of your code (and
build process, if any?) for me to reproduce that?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#366 (reply in thread)
|
Beta Was this translation helpful? Give feedback.
DT_FLOAT32
is a Draco constant, it sounds like the file you're trying to load might require Draco decompression? If so, you'd need to use thedraco3dgltf
npm package and register it as shown here:https://gltf-transform.donmccurdy.com/classes/extensions.dracomeshcompression.html#example