Skip to content

Commit b685942

Browse files
authored
Merge pull request #16265 from Mugen87/dev28
GLTFExporter: Fix export of multi-material meshes.
2 parents a4a5bec + aa3243f commit b685942

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/js/exporters/GLTFExporter.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,14 +1358,16 @@ THREE.GLTFExporter.prototype = {
13581358

13591359
if ( geometry.index !== null ) {
13601360

1361-
if ( cachedData.attributes.has( geometry.index ) ) {
1361+
var cacheKey = geometry.uuid + ':' + groups[ i ].start + ':' + groups[ i ].count;
1362+
1363+
if ( cachedData.attributes.has( cacheKey ) ) {
13621364

13631365
primitive.indices = cachedData.attributes.get( geometry.index );
13641366

13651367
} else {
13661368

13671369
primitive.indices = processAccessor( geometry.index, geometry, groups[ i ].start, groups[ i ].count );
1368-
cachedData.attributes.set( geometry.index, primitive.indices );
1370+
cachedData.attributes.set( cacheKey, primitive.indices );
13691371

13701372
}
13711373

0 commit comments

Comments
 (0)