-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Implement the AnimationGraph
, allowing for multiple animations to be blended together.
#11989
Implement the AnimationGraph
, allowing for multiple animations to be blended together.
#11989
Conversation
blended together. This is an implementation of RFC bevyengine#51: https://github.com/bevyengine/rfcs/blob/main/rfcs/51-animation-composition.md Note that the implementation strategy is different from the one outlined in that RFC, because two-phase animation has now landed.
I removed the Controversial label as this is implementing an approved RFC. |
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.
Looks good overall, no special concern or comment
This isn't done yet.
The generated |
1 similar comment
The generated |
The generated |
OK, I'm much happier with this. I've solved the problems of animation ordering and removed the "scheduled animation" overhead. This should be ready for re-review. |
Improved the example a bit, thanks to @rparrett. |
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.
I'm overall happy with the current state of this PR. Given the size of the PR, I'm opting to skip the smaller nits and opt to iteratively improve upon the implementation.
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.
Really pleased with the documentation and general care shown here. I'm content with the level of review from subject matter experts, and the examples appear to work correctly for me.
There's definitely some general-purpose abstractions missing on the asset management side, but I'm content with this for now. It'll be useful to have this in place to help us figure out a design there.
However, I'm getting a bunch of warnings like:
2024-03-07T15:32:36.708431Z WARN bevy_animation: Couldn't find the animation player 53v1 for the target entity 49v1 (Some("b_LeftLeg02_016"))
on both the animated_fox and animation_graph examples. This doesn't appear to be present on main
. I suspect a system ordering problem.
Once those are fixed up I'm happy to approve and merge.
These started showing up after 283a4d0. I have some more ideas for the examples, but I will follow up later. They're definitely in a good enough state. So "approved," but I only looked at the examples. |
and is harmless, and fix the system order in the examples
I demoted the warnings to traces because they're relatively common and harmless now. They'll occur whenever you load a glTF and haven't added an I also switched the system order to hopefully avoid 1-frame lag (and avoid those traces) in the examples. |
…e blended together. (bevyengine#11989) This is an implementation of RFC bevyengine#51: https://github.com/bevyengine/rfcs/blob/main/rfcs/51-animation-composition.md Note that the implementation strategy is different from the one outlined in that RFC, because two-phase animation has now landed. # Objective Bevy needs animation blending. The RFC for this is [RFC 51]. ## Solution This is an implementation of the RFC. Note that the implementation strategy is different from the one outlined there, because two-phase animation has now landed. This is just a draft to get the conversation started. Currently we're missing a few things: - [x] A fully-fleshed-out mechanism for transitions - [x] A serialization format for `AnimationGraph`s - [x] Examples are broken, other than `animated_fox` - [x] Documentation --- ## Changelog ### Added * The `AnimationPlayer` has been reworked to support blending multiple animations together through an `AnimationGraph`, and as such will no longer function unless a `Handle<AnimationGraph>` has been added to the entity containing the player. See [RFC 51] for more details. * Transition functionality has moved from the `AnimationPlayer` to a new component, `AnimationTransitions`, which works in tandem with the `AnimationGraph`. ## Migration Guide * `AnimationPlayer`s can no longer play animations by themselves and need to be paired with a `Handle<AnimationGraph>`. Code that was using `AnimationPlayer` to play animations will need to create an `AnimationGraph` asset first, add a node for the clip (or clips) you want to play, and then supply the index of that node to the `AnimationPlayer`'s `play` method. * The `AnimationPlayer::play_with_transition()` method has been removed and replaced with the `AnimationTransitions` component. If you were previously using `AnimationPlayer::play_with_transition()`, add all animations that you were playing to the `AnimationGraph`, and create an `AnimationTransitions` component to manage the blending between them. [RFC 51]: https://github.com/bevyengine/rfcs/blob/main/rfcs/51-animation-composition.md --------- Co-authored-by: Rob Parrett <robparrett@gmail.com>
…14853) # Objective Add a convenience constructor to make simple animation graphs easier to build. I've had some notes about attempting this since #11989 that I just remembered after seeing #14852. This partially addresses #14852, but I don't really know animation well enough to write all of the documentation it's asking for. ## Solution Add `AnimationGraph::from_clips` and use it to simplify `animated_fox`. Do some other little bits of incidental cleanup and documentation . ## Testing I ran `cargo run --example animated_fox`.
This is an implementation of RFC #51: https://github.com/bevyengine/rfcs/blob/main/rfcs/51-animation-composition.md
Note that the implementation strategy is different from the one outlined in that RFC, because two-phase animation has now landed.
Objective
Bevy needs animation blending. The RFC for this is RFC 51.
Solution
This is an implementation of the RFC. Note that the implementation strategy is different from the one outlined there, because two-phase animation has now landed.
This is just a draft to get the conversation started. Currently we're missing a few things:
AnimationGraph
sanimated_fox
Changelog
Added
The
AnimationPlayer
has been reworked to support blending multiple animations together through anAnimationGraph
, and as such will no longer function unless aHandle<AnimationGraph>
has been added to the entity containing the player. See RFC 51 for more details.Transition functionality has moved from the
AnimationPlayer
to a new component,AnimationTransitions
, which works in tandem with theAnimationGraph
.Migration Guide
AnimationPlayer
s can no longer play animations by themselves and need to be paired with aHandle<AnimationGraph>
. Code that was usingAnimationPlayer
to play animations will need to create anAnimationGraph
asset first, add a node for the clip (or clips) you want to play, and then supply the index of that node to theAnimationPlayer
'splay
method.The
AnimationPlayer::play_with_transition()
method has been removed and replaced with theAnimationTransitions
component. If you were previously usingAnimationPlayer::play_with_transition()
, add all animations that you were playing to theAnimationGraph
, and create anAnimationTransitions
component to manage the blending between them.