浏览代码

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 年之前
父节点
当前提交
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 { TGALoader } from 'three/addons/loaders/TGALoader.js';
 
 
 import { AddObjectCommand } from './commands/AddObjectCommand.js';
 import { AddObjectCommand } from './commands/AddObjectCommand.js';
-import { SetSceneCommand } from './commands/SetSceneCommand.js';
 
 
 import { LoaderUtils } from './LoaderUtils.js';
 import { LoaderUtils } from './LoaderUtils.js';
 
 
@@ -657,7 +656,7 @@ fileHandlers[ 'wrl' ] = function ( editor, manager, reader, file ) {
 
 
 		const result = new VRMLLoader().parse( contents );
 		const result = new VRMLLoader().parse( contents );
 
 
-		editor.execute( new SetSceneCommand( editor, result ) );
+		editor.execute( new AddObjectCommand( editor, result ) );
 
 
 	}, false );
 	}, false );
 	reader.readAsText( file );
 	reader.readAsText( file );
@@ -758,15 +757,7 @@ function handleJSON( editor, texturePath, data ) {
 
 
 			loader.parse( data, function ( result ) {
 			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 ) );
 
 
 			} );
 			} );