-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Unified Transform
blend stack
#15665
Open
mweatherley
wants to merge
18
commits into
bevyengine:main
Choose a base branch
from
mweatherley:unified-transform-stack
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+547
−173
Conversation
This file contains 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
mweatherley
added
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
A-Animation
Make things move and change over time
S-Waiting-on-Author
The author needs to make changes or address concerns before this can be merged
labels
Oct 5, 2024
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.
mweatherley
added
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
S-Needs-Review
Needs reviewer attention (from anyone!) to move forward
and removed
S-Waiting-on-Author
The author needs to make changes or address concerns before this can be merged
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
labels
Oct 7, 2024
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-Needs-Review
Needs reviewer attention (from anyone!) to move forward
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, theTransformCurve
wrapper had to be killed in the migration to blend stacks (#15589, #15598) becauseTransform
would fight with all of its parts over write access to the actualTransform
component.The goal of this PR is to reintroduce
TransformCurve
by making all the animated parts ofTransform
(TranslationCurve
,RotationCurve
,ScaleCurve
) share the same blend stack. This allowsTransformCurve
to 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
Animatable
typeTransformParts
has been introduced:Subsequently,
TranslationCurve
,RotationCurve
,ScaleCurve
, andTransformCurve
all share a single blend stack where the individual elements areTransformParts
. For example, whenTranslationCurve
contributes an element to the blend stack, it sets therotation
andscale
components 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_animation
has 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_foxes
and found little to no performance difference. Testing onanimation_graph
helps assure that nothing broke in the migration to the unified blend stack.Showcase
Screen.Recording.2024-10-07.at.11.06.52.AM.mov