Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Avoid SetSceneCommnd when importing file #28339

Merged
merged 3 commits into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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