浏览代码

Merge pull request #19898 from johnmarinelli/bug-18986

FBXLoader: Added check before parsing UVs
Mr.doob 5 年之前
父节点
当前提交
7c936a7c03
共有 2 个文件被更改,包括 12 次插入2 次删除
  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;
 				var i = 0;
 				while ( geoNode.LayerElementUV[ i ] ) {
 				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 ++;
 					i ++;
 
 
 				}
 				}

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

@@ -1773,7 +1773,12 @@ var FBXLoader = ( function () {
 				var i = 0;
 				var i = 0;
 				while ( geoNode.LayerElementUV[ i ] ) {
 				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 ++;
 					i ++;
 
 
 				}
 				}