Skip to content

Commit

Permalink
fileMap should exist when parsing (#23097)
Browse files Browse the repository at this point in the history
* fileMap should exist when parsing

* always set fileMap to new Object()
  • Loading branch information
gero3 authored Dec 28, 2021
1 parent 5169da8 commit fbd067f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion editor/js/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ function Loader( editor ) {
var { LDrawLoader } = await import( '../../examples/jsm/loaders/LDrawLoader.js' );

var loader = new LDrawLoader();
loader.fileMap = {}; // TODO Uh...
loader.setPath( '../../examples/models/ldraw/officialLibrary/' );
loader.parse( event.target.result, undefined, function ( group ) {

Expand Down
8 changes: 1 addition & 7 deletions examples/jsm/loaders/LDrawLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ class LDrawLoader extends Loader {
this.cache = new LDrawFileCache( this );

// This object is a map from file names to paths. It agilizes the paths search. If it is not set then files will be searched by trial and error.
this.fileMap = null;
this.fileMap = {};

this.rootParseScope = this.newParseScopeLevel();

Expand Down Expand Up @@ -874,12 +874,6 @@ class LDrawLoader extends Loader {

load( url, onLoad, onProgress, onError ) {

if ( ! this.fileMap ) {

this.fileMap = {};

}

const fileLoader = new FileLoader( this.manager );
fileLoader.setPath( this.path );
fileLoader.setRequestHeader( this.requestHeader );
Expand Down

0 comments on commit fbd067f

Please sign in to comment.