Skip to content

Commit

Permalink
Editor: Avoid SetSceneCommnd when importing file (#28339)
Browse files Browse the repository at this point in the history
* avoid SetSceneCommand when importing

* Update Loader.js

Fix formatting.

---------

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
ycw and Mugen87 committed May 15, 2024
1 parent ce4536a commit b3e3724
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions editor/js/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 ) );

} );

Expand Down

0 comments on commit b3e3724

Please sign in to comment.