Skip to content
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

AnimationClipCreator: Fix timeStep logic in CreateMaterialColorAnimation(). #29111

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

JiDW
Copy link
Contributor

@JiDW JiDW commented Aug 11, 2024

Description

While trying to understand how to use ColorKeyframeTrack, I found an error in the example provided.

timeStep was incorrectly calculating the times array parameter, making the animation play faster and end before the targeted duration.

For duration = 5 and colors.length = 2, times would have been [0, 2.5] instead of [0,5]

Demo with the fix applied:

https://jsfiddle.net/y9kwfje8/

@Mugen87 Mugen87 merged commit f7c92c8 into mrdoob:dev Aug 13, 2024
10 of 11 checks passed
@Mugen87 Mugen87 added this to the r168 milestone Aug 13, 2024
@Mugen87 Mugen87 changed the title Fix timeStep logic in CreateMaterialColorAnimation AnimationClipCreator: Fix timeStep logic in CreateMaterialColorAnimation(). Aug 13, 2024
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.

2 participants