From 44062edc50132ad4a5d72ac8f1686eb77dcbde7f Mon Sep 17 00:00:00 2001 From: ycw Date: Sun, 12 May 2024 03:43:03 +0800 Subject: [PATCH 1/2] avoid SetSceneCommand when importing --- editor/js/Loader.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/editor/js/Loader.js b/editor/js/Loader.js index a5cea2ce2e5a5..43bee4324cffe 100644 --- a/editor/js/Loader.js +++ b/editor/js/Loader.js @@ -3,7 +3,6 @@ import * as THREE from 'three'; import { TGALoader } from 'three/addons/loaders/TGALoader.js'; import { AddObjectCommand } from './commands/AddObjectCommand.js'; -import { SetSceneCommand } from './commands/SetSceneCommand.js'; import { LoaderUtils } from './LoaderUtils.js'; @@ -715,7 +714,7 @@ function Loader( editor ) { const result = new VRMLLoader().parse( contents ); - editor.execute( new SetSceneCommand( editor, result ) ); + editor.execute( new AddObjectCommand( editor, result ) ); }, false ); reader.readAsText( file ); @@ -828,15 +827,7 @@ function Loader( editor ) { loader.parse( data, function ( result ) { - if ( result.isScene ) { - - editor.execute( new SetSceneCommand( editor, result ) ); - - } else { - - editor.execute( new AddObjectCommand( editor, result ) ); - - } + editor.execute( new AddObjectCommand( editor, result ) ); } ); From 4360aca9afb0dd92b03de002fc31befa79617198 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Wed, 15 May 2024 11:22:41 +0200 Subject: [PATCH 2/2] Update Loader.js Fix formatting. --- editor/js/Loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/js/Loader.js b/editor/js/Loader.js index 67c6dca72ba2d..8bb09598e31c3 100644 --- a/editor/js/Loader.js +++ b/editor/js/Loader.js @@ -757,7 +757,7 @@ function handleJSON( editor, texturePath, data ) { loader.parse( data, function ( result ) { - editor.execute( new AddObjectCommand( editor, result ) ); + editor.execute( new AddObjectCommand( editor, result ) ); } );