Skip to content

Conversation

@takahirox
Copy link
Collaborator

We need to remove existing morphDictionary entries in case targetNames is defined, not to have duplicate dictionary entry.


dictionary[ targetNames[ i ] ] = i;

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just reset mesh.morphTargetDictionary = {}? And because extras.targetNames is already an unofficial property, I think we should be very strict about what it can contain. If the length does not match, ignore the whole thing or even log an error.

if ( Object.keys( dictionary ).length === targetNames.length ) {

  // ...

} else {

  console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' );

}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that idea because it's easier. Updated. Thanks.

@mrdoob mrdoob added this to the r92 milestone Apr 12, 2018
@mrdoob mrdoob merged commit 3800256 into mrdoob:dev Apr 12, 2018
@mrdoob
Copy link
Owner

mrdoob commented Apr 12, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants