فهرست منبع

FBXLoader: Simplify polygon check. (#25035)

* Revert "FBXLoader: Add warning about unsupported polygons. (#25030)"

This reverts commit a3b3d826c74569a76bd580b0daa41f22abb60605.

* FBXLoader: Add warning about unsupported polygons.
Michael Herzog 2 سال پیش
والد
کامیت
7e71c6a526
1فایلهای تغییر یافته به همراه2 افزوده شده و 9 حذف شده
  1. 2 9
      examples/jsm/loaders/FBXLoader.js

+ 2 - 9
examples/jsm/loaders/FBXLoader.js

@@ -1786,7 +1786,6 @@ class GeometryParser {
 
 		let polygonIndex = 0;
 		let faceLength = 0;
-		let polygonSides = 0;
 		let displayedWeightsWarning = false;
 
 		// these will hold data for a single face
@@ -1815,14 +1814,6 @@ class GeometryParser {
 				vertexIndex = vertexIndex ^ - 1; // equivalent to ( x * -1 ) - 1
 				endOfFace = true;
 
-				if ( polygonSides > 3 ) console.warn( 'THREE.FBXLoader: Polygons with more than three sides are not supported. Make sure to triangulate the geometry during export.' );
-
-				polygonSides = 0;
-
-			} else {
-
-				polygonSides ++;
-
 			}
 
 			let weightIndices = [];
@@ -1952,6 +1943,8 @@ class GeometryParser {
 
 			if ( endOfFace ) {
 
+				if ( faceLength > 4 ) console.warn( 'THREE.FBXLoader: Polygons with more than four sides are not supported. Make sure to triangulate the geometry during export.' );
+
 				scope.genFace( buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength );
 
 				polygonIndex ++;