Browse Source

Merge pull request #19898 from johnmarinelli/bug-18986

FBXLoader: Added check before parsing UVs
Mr.doob 5 years ago
parent
commit
7c936a7c03
2 changed files with 12 additions and 2 deletions
  1. 6 1
      examples/js/loaders/FBXLoader.js
  2. 6 1
      examples/jsm/loaders/FBXLoader.js

+ 6 - 1
examples/js/loaders/FBXLoader.js

@@ -1727,7 +1727,12 @@ THREE.FBXLoader = ( function () {
 				var i = 0;
 				while ( geoNode.LayerElementUV[ i ] ) {
 
-					geoInfo.uv.push( this.parseUVs( geoNode.LayerElementUV[ i ] ) );
+					if ( geoNode.LayerElementUV[ i ].UV ) {
+
+						geoInfo.uv.push( this.parseUVs( geoNode.LayerElementUV[ i ] ) );
+
+					}
+
 					i ++;
 
 				}

+ 6 - 1
examples/jsm/loaders/FBXLoader.js

@@ -1773,7 +1773,12 @@ var FBXLoader = ( function () {
 				var i = 0;
 				while ( geoNode.LayerElementUV[ i ] ) {
 
-					geoInfo.uv.push( this.parseUVs( geoNode.LayerElementUV[ i ] ) );
+					if ( geoNode.LayerElementUV[ i ].UV ) {
+
+						geoInfo.uv.push( this.parseUVs( geoNode.LayerElementUV[ i ] ) );
+
+					}
+
 					i ++;
 
 				}