From 7f7b68f8bc88b74696f00dff8bcedc9ab4cee734 Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Sun, 26 Jul 2020 18:15:59 +0200 Subject: [PATCH] Editor: Add missing DRACOLoader for zipped glTF assets. --- editor/js/Loader.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/js/Loader.js b/editor/js/Loader.js index 15e248351a9ad0..1530eb61ab378e 100644 --- a/editor/js/Loader.js +++ b/editor/js/Loader.js @@ -654,7 +654,12 @@ function Loader( editor ) { case 'glb': + var dracoLoader = new DRACOLoader(); + dracoLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' ); + var loader = new GLTFLoader(); + loader.setDRACOLoader( dracoLoader ); + loader.parse( file.asArrayBuffer(), '', function ( result ) { var scene = result.scene; @@ -668,7 +673,11 @@ function Loader( editor ) { case 'gltf': + var dracoLoader = new DRACOLoader(); + dracoLoader.setDecoderPath( '../examples/js/libs/draco/gltf/' ); + var loader = new GLTFLoader( manager ); + loader.setDRACOLoader( dracoLoader ); loader.parse( file.asText(), '', function ( result ) { var scene = result.scene;