Browse Source

GLTFExporter: Add geometry.index === null check for createing index

Takahiro 7 years ago
parent
commit
39759360bf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/js/exporters/GLTFExporter.js

+ 2 - 2
examples/js/exporters/GLTFExporter.js

@@ -1007,10 +1007,10 @@ THREE.GLTFExporter.prototype = {
 			var forceIndices = options.forceIndices;
 			var isMultiMaterial = Array.isArray( mesh.material );
 
-			if ( ! forceIndices && isMultiMaterial ) {
+			if ( ! forceIndices && geometry.index === null && isMultiMaterial ) {
 
 				// temporal workaround.
-				console.warn( 'THREE.GLTFExporter: Force index for a mesh with multi-material.', mesh );
+				console.warn( 'THREE.GLTFExporter: Creating index for non-indexed multi-material mesh.' );
 				forceIndices = true;
 
 			}