Kaynağa Gözat

fileMap should exist when parsing (#23097)

* fileMap should exist when parsing

* always set fileMap to new Object()
gero3 3 yıl önce
ebeveyn
işleme
fbd067f0b8
2 değiştirilmiş dosya ile 1 ekleme ve 8 silme
  1. 0 1
      editor/js/Loader.js
  2. 1 7
      examples/jsm/loaders/LDrawLoader.js

+ 0 - 1
editor/js/Loader.js

@@ -392,7 +392,6 @@ function Loader( editor ) {
 					var { LDrawLoader } = await import( '../../examples/jsm/loaders/LDrawLoader.js' );
 					var { LDrawLoader } = await import( '../../examples/jsm/loaders/LDrawLoader.js' );
 
 
 					var loader = new LDrawLoader();
 					var loader = new LDrawLoader();
-					loader.fileMap = {}; // TODO Uh...
 					loader.setPath( '../../examples/models/ldraw/officialLibrary/' );
 					loader.setPath( '../../examples/models/ldraw/officialLibrary/' );
 					loader.parse( event.target.result, undefined, function ( group ) {
 					loader.parse( event.target.result, undefined, function ( group ) {
 
 

+ 1 - 7
examples/jsm/loaders/LDrawLoader.js

@@ -815,7 +815,7 @@ class LDrawLoader extends Loader {
 		this.cache = new LDrawFileCache( this );
 		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 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();
 		this.rootParseScope = this.newParseScopeLevel();
 
 
@@ -874,12 +874,6 @@ class LDrawLoader extends Loader {
 
 
 	load( url, onLoad, onProgress, onError ) {
 	load( url, onLoad, onProgress, onError ) {
 
 
-		if ( ! this.fileMap ) {
-
-			this.fileMap = {};
-
-		}
-
 		const fileLoader = new FileLoader( this.manager );
 		const fileLoader = new FileLoader( this.manager );
 		fileLoader.setPath( this.path );
 		fileLoader.setPath( this.path );
 		fileLoader.setRequestHeader( this.requestHeader );
 		fileLoader.setRequestHeader( this.requestHeader );