Add a curve sampling method to the AnimationClip API#24152
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom May 7, 2026
Merged
Add a curve sampling method to the AnimationClip API#24152alice-i-cecile merged 1 commit intobevyengine:mainfrom
alice-i-cecile merged 1 commit intobevyengine:mainfrom
Conversation
3964341 to
7410554
Compare
Member
|
@emberlightstudios I'd love your review here :) |
alice-i-cecile
approved these changes
May 6, 2026
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
Surprisingly simple and well-motivated.
Zeophlite
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Add a method to
AnimationClipto sample a property at a specific time. This is the first point proposed in #23355. The original goal was to allow the development of root motion, but it turns out that this API improvement can be useful for third party crates or games that need to sample animation curves directly. This PR is also inspired by the previous work in #16395.Solution
Add a method
sample_clampedtoAnimationClip:This method requires to add another
sample_clampedmethod to theAnimationCurvetrait:Testing
There is 2 new tests. One at the
AnimationCurvelevel and one at theAnimationCliplevel. There is also an example in the method's documentation.