From 39759360bf90488326a580659662b45d98fd56cc Mon Sep 17 00:00:00 2001 From: Takahiro Date: Mon, 12 Mar 2018 23:11:33 +0900 Subject: [PATCH] GLTFExporter: Add geometry.index === null check for createing index --- examples/js/exporters/GLTFExporter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index c19474fc94..c4cb3b2e5f 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/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; } -- GitLab