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

Commit

Permalink
fix(GLTFImporter): fix GLTF Draco normals
Browse files Browse the repository at this point in the history
  • Loading branch information
daker committed Dec 19, 2024
1 parent 89758ed commit 3c9e647
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 159 deletions.
11 changes: 4 additions & 7 deletions Sources/IO/Geometry/DracoReader/example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,13 @@ function update() {
// Dynamic script loading from CDN
// ----------------------------------------------------------------------------

// Prevent error when draco try to set the export on module
window.module = {};

// Add new script tag with draco CDN
vtkResourceLoader
.loadScript('https://unpkg.com/draco3d@1.3.4/draco_decoder_nodejs.js')
.then(() => {
.loadScript('https://unpkg.com/draco3d@1.5.7/draco_decoder_nodejs.js')
.then(async () => {
// Set decoder function to the vtk reader
vtkDracoReader.setDracoDecoder(window.CreateDracoModule);

// eslint-disable-next-line no-undef
await vtkDracoReader.setDracoDecoder(DracoDecoderModule);
// Trigger data download
reader
.setUrl(
Expand Down
8 changes: 4 additions & 4 deletions Sources/IO/Geometry/DracoReader/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ export function newInstance(
): vtkDracoReader;

/**
*
* Get the draco decoder
*/
export function getDracoDecoder(): any;

/**
*
* @param createDracoModule
* Set the draco decoder
* @param dracoDecoder
*/
export function setDracoDecoder(createDracoModule: any): void;
export async function setDracoDecoder(dracoDecoder: any): void;

/**
* Load the WASM decoder from url and set the decoderModule
Expand Down
Loading

0 comments on commit 3c9e647

Please sign in to comment.