File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1885,7 +1885,7 @@ class LDrawLoader extends Loader {
18851885
18861886 }
18871887
1888- this . setMaterials ( materials ) ;
1888+ this . addMaterials ( materials ) ;
18891889
18901890 }
18911891
@@ -1907,7 +1907,7 @@ class LDrawLoader extends Loader {
19071907 fileLoader . load ( url , text => {
19081908
19091909 // Initializes the materials library with default materials
1910- this . setMaterials ( [ ] ) ;
1910+ this . addMaterials ( [ ] ) ;
19111911
19121912 this . partsCache
19131913 . parseModel ( text )
@@ -1948,10 +1948,18 @@ class LDrawLoader extends Loader {
19481948
19491949 }
19501950
1951- setMaterials ( materials ) {
1951+ setMaterials ( materials ) {
1952+ this . clearMaterials ( ) ;
1953+ this . addMaterials ( materials ) ;
1954+ }
19521955
1956+ clearMaterials ( ) {
19531957 this . materialLibrary = { } ;
19541958 this . materials = [ ] ;
1959+ }
1960+
1961+ addMaterials ( materials ) {
1962+
19551963 for ( let i = 0 , l = materials . length ; i < l ; i ++ ) {
19561964
19571965 this . addMaterial ( materials [ i ] ) ;
You can’t perform that action at this time.
0 commit comments