diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index ba67abc171f5684c67ce1955ad1a9bafe1815499..9a0ae745b4f7f445c5507b51aa195d22afbaa675 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -1004,9 +1004,19 @@ THREE.GLTFExporter.prototype = { } + var forceIndices = options.forceIndices; + + if ( ! forceIndices && Array.isArray( mesh.material ) ) { + + // temporal workaround. + console.warn( 'THREE.GLTFExporter: Force index for a mesh with multi-material.', mesh ); + forceIndices = true; + + } + var forcedIndex = false; - if ( geometry.index === null && options.forceIndices ) { + if ( geometry.index === null && forceIndices ) { var indices = new Uint32Array( geometry.attributes.position.count );