@@ -8,28 +8,25 @@ import { writeMetadata } from './common';
88import { draco , DRACO_DEFAULTS } from '@gltf-transform/functions' ;
99import draco3d from 'draco3dgltf' ;
1010
11- let io ;
12- ( async ( ) => {
13- io = new WebIO ( )
14- . registerDependencies ( {
15- 'draco3d.decoder' : await draco3d . createDecoderModule ( {
16- locateFile : ( file ) => {
17- return `/static/${ file } ` ;
18- } ,
19- print : console . log ,
20- printErr : console . error ,
21- } ) ,
22- 'draco3d.encoder' : await draco3d . createEncoderModule ( {
23- locateFile : ( file ) => {
24- return `/static/${ file } ` ;
25- } ,
26- print : console . log ,
27- printErr : console . error ,
28- } ) ,
29- } )
30- . registerExtensions ( ALL_EXTENSIONS ) ;
31- } ) ( ) ;
3211
12+ const io = new WebIO ( )
13+ . registerDependencies ( {
14+ 'draco3d.decoder' : await draco3d . createDecoderModule ( {
15+ locateFile : ( file ) => {
16+ return `/static/${ file } ` ;
17+ } ,
18+ print : console . log ,
19+ printErr : console . error ,
20+ } ) ,
21+ 'draco3d.encoder' : await draco3d . createEncoderModule ( {
22+ locateFile : ( file ) => {
23+ return `/static/${ file } ` ;
24+ } ,
25+ print : console . log ,
26+ printErr : console . error ,
27+ } ) ,
28+ } )
29+ . registerExtensions ( ALL_EXTENSIONS ) ;
3330// Helper function to convert uint32 (assumed format 0xAARRGGBB) to normalized [r, g, b, a]
3431function uint32ToRGBA ( color ) {
3532 const a = ( ( color >> 24 ) & 0xFF ) / 255 ;
0 commit comments