diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index 4be2647fd6615b9b7a6a99f124427393db7fdd1f..d8d9eb3a2bca1afba951cc2bf6604d4ba8cde764 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -1358,14 +1358,16 @@ THREE.GLTFExporter.prototype = { if ( geometry.index !== null ) { - if ( cachedData.attributes.has( geometry.index ) ) { + var cacheKey = geometry.uuid + ':' + groups[ i ].start + ':' + groups[ i ].count; + + if ( cachedData.attributes.has( cacheKey ) ) { primitive.indices = cachedData.attributes.get( geometry.index ); } else { primitive.indices = processAccessor( geometry.index, geometry, groups[ i ].start, groups[ i ].count ); - cachedData.attributes.set( geometry.index, primitive.indices ); + cachedData.attributes.set( cacheKey, primitive.indices ); }