Browse Source

Geometry: Avoid creating undefined uvs in .fromBufferGeometry(). Fixes #5567.

Mr.doob 10 years ago
parent
commit
83807eadf8
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/core/Geometry.js

+ 6 - 1
src/core/Geometry.js

@@ -140,7 +140,12 @@ THREE.Geometry.prototype = {
 			var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : [];
 
 			scope.faces.push( new THREE.Face3( a, b, c, vertexNormals, vertexColors ) );
-			scope.faceVertexUvs[ 0 ].push( [ tempUVs[ a ], tempUVs[ b ], tempUVs[ c ] ] );
+
+			if ( uvs !== undefined ) {
+
+				scope.faceVertexUvs[ 0 ].push( [ tempUVs[ a ], tempUVs[ b ], tempUVs[ c ] ] );
+
+			}
 
 		};