Getting a TypeError When Using KHRDracoMeshCompression - Am I Doing Something Wrong? #1311
Closed
Jonathynlee
started this conversation in
General
Replies: 2 comments
-
The code looks correct to me. Are using a bundler, or running this code directly in node.js? And, which versions of node.js and glTF Transform? It might be worth trying to reorganize it so the async/await is a bit simpler, I'm wondering if a bundler might be doing something unexpected there, or if creating the draco module multiple times is a problem. import { Document, NodeIO } from '@gltf-transform/core';
import { KHRDracoMeshCompression} from '@gltf-transform/extensions';
import * as draco3d from 'draco3dgltf';
const io = new NodeIO()
.registerExtensions([KHRDracoMeshCompression])
.registerDependencies({
'draco3d.decoder': await draco3d.createDecoderModule(),
'draco3d.encoder': await draco3d.createEncoderModule(),
});
export function convertGltfToDocument(path: string): Promise<Document> {
return io.read(path);
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
@donmccurdy thanks for the quick response. Looks like moving it into one file fixes the issue. I appreciate the help. Cheers! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
When simply trying to import a draco compressed glb, I am getting the following error.
Here is my code:
I have validated to glb is valid and loads as well.
Thanks in advanced!
-Jonathyn
Beta Was this translation helpful? Give feedback.
All reactions