-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Morph target animation fix #4532
Conversation
Could you please explain what this does? you add the prefix, and later strip it. |
if (weightName.indexOf('name.') === 0) { | ||
weightName = weightName.replace('name.', ''); | ||
} else { | ||
weightName = Number(weightName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth checking for NaN here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always be the index of the morph target as a string.
(approved, but pls wait for @mvaligursky to also approve before merging) |
The prefix is only added to morph target curves which are named via the mesh's extras property. This means we can differentiate them at binding time from indexed morph target curves, passing them to the setWeight function as a string instead of a number. Then those named curves will be referenced against the name lookup table, indexed curves will behave as before. |
Morph target animation curves that are named via the glb mesh's extras property should be differentiated from index based curves.
Fixes #4522
Fixes #4520
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.