Skip to content

Commit

Permalink
avoid SetSceneCommand when importing
Browse files Browse the repository at this point in the history
  • Loading branch information
ycw committed May 14, 2024
1 parent 4ec57f5 commit 44062ed
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 @@ -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 );
Expand Down Expand Up @@ -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 ) );

} );

Expand Down

0 comments on commit 44062ed

Please sign in to comment.