Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

Commit 8b04d23

Browse files
Update GM Viewer
1 parent 5cf7808 commit 8b04d23

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

viewers/templates/GM Viewer.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@
544544

545545
const compressedArrayBuffer = await io.writeBinary( doc );
546546

547+
for (const texture of doc.getRoot().listTextures()) { texture.dispose(); }
547548
for (const material of doc.getRoot().listMaterials()) { material.dispose(); }
548549
for (const mesh of doc.getRoot().listMeshes()) { mesh.dispose(); }
549550

@@ -579,7 +580,7 @@
579580
const textures = doc.getRoot().listTextures();
580581

581582
if (textures.length > 0 && (tex_fmt !== '' || tex_res !== Infinity || tex_flip === true)) {
582-
await process_textures( textures, doc, ALL_EXTENSIONS, true );
583+
await process_textures( textures, doc, ALL_EXTENSIONS );
583584
}
584585

585586
doc.createExtension( ALL_EXTENSIONS[ 4 ] )
@@ -631,7 +632,7 @@
631632
const textures = doc.getRoot().listTextures();
632633

633634
if (textures.length > 0 && (tex_fmt !== '' || tex_res !== Infinity || tex_flip === true)) {
634-
await process_textures( textures, doc, ALL_EXTENSIONS, true );
635+
await process_textures( textures, doc, ALL_EXTENSIONS );
635636
}
636637

637638
doc.createExtension( ALL_EXTENSIONS[ 1 ] )
@@ -649,7 +650,7 @@
649650
return compressedArrayBuffer;
650651
}
651652

652-
/* Encode textures only with either of WEBP or KTX2 compression */
653+
/* Encode textures only */
653654

654655
async function texture_compress( arrayBuffer ) {
655656
const { WebIO } = await import( "@gltf-transform/core" );
@@ -674,7 +675,7 @@
674675
const textures = doc.getRoot().listTextures();
675676

676677
if (textures.length > 0 && (tex_fmt !== '' || tex_res !== Infinity || tex_flip === true)) {
677-
await process_textures( textures, doc, ALL_EXTENSIONS, true );
678+
await process_textures( textures, doc, ALL_EXTENSIONS );
678679
}
679680

680681
const compressedArrayBuffer = await io.writeBinary( doc );

0 commit comments

Comments
 (0)