File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ THREE.OBJLoader = ( function () {
1010 var material_library_pattern = / ^ m t l l i b / ;
1111 // usemtl material_name
1212 var material_use_pattern = / ^ u s e m t l / ;
13+ // usemap map_name
14+ var map_use_pattern = / ^ u s e m a p / ;
1315
1416 function ParserState ( ) {
1517
@@ -570,6 +572,13 @@ THREE.OBJLoader = ( function () {
570572
571573 state . materialLibraries . push ( line . substring ( 7 ) . trim ( ) ) ;
572574
575+ } else if ( map_use_pattern . test ( line ) ) {
576+
577+ // the line is parsed but ignored since the loader assumes textures are defined MTL files
578+ // (according to https://www.okino.com/conv/imp_wave.htm, 'usemap' is the old-style Wavefront texture reference method)
579+
580+ console . warn ( 'THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.' ) ;
581+
573582 } else if ( lineFirstChar === 's' ) {
574583
575584 result = line . split ( ' ' ) ;
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ var OBJLoader = ( function () {
2727 var material_library_pattern = / ^ m t l l i b / ;
2828 // usemtl material_name
2929 var material_use_pattern = / ^ u s e m t l / ;
30+ // usemap map_name
31+ var map_use_pattern = / ^ u s e m a p / ;
3032
3133 function ParserState ( ) {
3234
@@ -587,6 +589,13 @@ var OBJLoader = ( function () {
587589
588590 state . materialLibraries . push ( line . substring ( 7 ) . trim ( ) ) ;
589591
592+ } else if ( map_use_pattern . test ( line ) ) {
593+
594+ // the line is parsed but ignored since the loader assumes textures are defined MTL files
595+ // (according to https://www.okino.com/conv/imp_wave.htm, 'usemap' is the old-style Wavefront texture reference method)
596+
597+ console . warn ( 'THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.' ) ;
598+
590599 } else if ( lineFirstChar === 's' ) {
591600
592601 result = line . split ( ' ' ) ;
You can’t perform that action at this time.
0 commit comments