Skip to content

Commit acec2bc

Browse files
committed
feat: support /nodes/{}/weights/{} even with multi-material meshes (primitives)
Utilized the existing code of the weights of multi-material meshes
1 parent debc58a commit acec2bc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/GLTFLoaderAnimationPointer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,11 @@ export class GLTFAnimationPointerExtension {
391391

392392
// specially handle the morphTargetInfluences property for multi-material meshes
393393
// in which case the target object is a Group and the children are the actual targets
394+
// Note that there is also morphTargetInfluences[i] for individual morph targets
394395
// see NE-3311
395-
if ( parts[ 3 ] === 'morphTargetInfluences' ) {
396+
if ( parts[ 3 ].startsWith( 'morphTargetInfluences' ) ) {
397+
398+
const property = parts[ 3 ];
396399

397400
if ( node.type === 'Group' ) {
398401

@@ -405,7 +408,7 @@ export class GLTFAnimationPointerExtension {
405408
if ( ch instanceof SkinnedMesh && ch.morphTargetInfluences ) {
406409

407410
parts[ 3 ] = ch.name;
408-
parts[ 4 ] = 'morphTargetInfluences';
411+
parts[ 4 ] = property;
409412
__createTrack( this.parser );
410413

411414
}

0 commit comments

Comments
 (0)