2
0
Эх сурвалжийг харах

Editor: Avoid `SetSceneCommnd` when importing file (#28339)

* avoid SetSceneCommand when importing

* Update Loader.js

Fix formatting.

---------

Co-authored-by: Michael Herzog <[email protected]>
ycw 1 жил өмнө
parent
commit
b3e3724eb0
1 өөрчлөгдсөн 2 нэмэгдсэн , 11 устгасан
  1. 2 11
      editor/js/Loader.js

+ 2 - 11
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';
 
@@ -657,7 +656,7 @@ fileHandlers[ 'wrl' ] = function ( editor, manager, reader, file ) {
 
 		const result = new VRMLLoader().parse( contents );
 
-		editor.execute( new SetSceneCommand( editor, result ) );
+		editor.execute( new AddObjectCommand( editor, result ) );
 
 	}, false );
 	reader.readAsText( file );
@@ -758,15 +757,7 @@ function handleJSON( editor, texturePath, data ) {
 
 			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 ) );
 
 			} );