Skip to content
/ vtk-js Public
forked from Kitware/vtk-js

Commit 0a95753

Browse files
committed
fix(GLTFImporter): fix GLTF Draco normals
fix Kitware#3192
1 parent 89758ed commit 0a95753

File tree

7 files changed

+210
-157
lines changed

7 files changed

+210
-157
lines changed

Sources/IO/Geometry/DracoReader/example/index.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,13 @@ function update() {
4949
// Dynamic script loading from CDN
5050
// ----------------------------------------------------------------------------
5151

52-
// Prevent error when draco try to set the export on module
53-
window.module = {};
54-
5552
// Add new script tag with draco CDN
5653
vtkResourceLoader
57-
.loadScript('https://unpkg.com/draco3d@1.3.4/draco_decoder_nodejs.js')
58-
.then(() => {
54+
.loadScript('https://unpkg.com/draco3d@1.5.7/draco_decoder_nodejs.js')
55+
.then(async () => {
5956
// Set decoder function to the vtk reader
60-
vtkDracoReader.setDracoDecoder(window.CreateDracoModule);
61-
57+
// eslint-disable-next-line no-undef
58+
await vtkDracoReader.setDracoDecoder(DracoDecoderModule);
6259
// Trigger data download
6360
reader
6461
.setUrl(

Sources/IO/Geometry/DracoReader/index.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ export function newInstance(
118118
): vtkDracoReader;
119119

120120
/**
121-
*
121+
* Get the draco decoder
122122
*/
123123
export function getDracoDecoder(): any;
124124

125125
/**
126-
*
127-
* @param createDracoModule
126+
* Set the draco decoder
127+
* @param dracoDecoder
128128
*/
129-
export function setDracoDecoder(createDracoModule: any): void;
129+
export async function setDracoDecoder(dracoDecoder: any): void;
130130

131131
/**
132132
* Load the WASM decoder from url and set the decoderModule

0 commit comments

Comments
 (0)