-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Unified Transform blend stack
#15665
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
Closed
Closed
Conversation
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
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 7, 2024
# Objective Fix a couple of substantial errors found during the development of #15665: - `AnimationCurveEvaluator::add` was secretly unreachable. In other words, additive blending never actually occurred. - Weights from the animation graph nodes were ignored, and only `ActiveAnimation`'s weights were used. ## Solution Made additive blending reachable and included the graph node weight in the weight of the stack elements appended in the curve application loop of `animate_targets`. ## Testing Tested on existing examples and on the new example added in #15665.
Contributor
Author
|
Closing because as of #16484 this would need to be completely reworked. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Animation
Make things move and change over time
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
S-Waiting-on-Author
The author needs to make changes or address concerns before this can be merged
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
Because curve-based animation (#15434) supports animating things based on arbitrary curves, it would be good to support
Curve<Transform>. Unfortunately, theTransformCurvewrapper had to be killed in the migration to blend stacks (#15589, #15598) becauseTransformwould fight with all of its parts over write access to the actualTransformcomponent.The goal of this PR is to reintroduce
TransformCurveby making all the animated parts ofTransform(TranslationCurve,RotationCurve,ScaleCurve) share the same blend stack. This allowsTransformCurveto function by sharing the same blend stack with all of them, so they simply blend harmoniously instead of fighting over the same component data.Solution
A new
AnimatabletypeTransformPartshas been introduced:Subsequently,
TranslationCurve,RotationCurve,ScaleCurve, andTransformCurveall share a single blend stack where the individual elements areTransformParts. For example, whenTranslationCurvecontributes an element to the blend stack, it sets therotationandscalecomponents to beNone, and you can probably guess how everything else goes from there; the only wrinkle is that when multiple curves are added from the same animation clip, they append to the same element on top of the stack instead of each getting their own element — this is for compatibility with assumptions in graph evaluation.An example
transform_curve_animationhas been added which shows a procedural animation defined by aCurve<Transform>with an animation defined by aCurve<Vec3>additively blended on top.Testing
Tested on
many_foxesand found little to no performance difference. Testing onanimation_graphhelps assure that nothing broke in the migration to the unified blend stack.Showcase
Screen.Recording.2024-10-07.at.11.06.52.AM.mov