bevy/crates
Patrick Walton dfdf2b9ea4
Implement the AnimationGraph, allowing for multiple animations to be blended together. (#11989)
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:

- [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>
2024-03-07 20:22:42 +00:00
..
bevy_a11y Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_animation Implement the AnimationGraph, allowing for multiple animations to be blended together. (#11989) 2024-03-07 20:22:42 +00:00
bevy_app Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_asset Implement the AnimationGraph, allowing for multiple animations to be blended together. (#11989) 2024-03-07 20:22:42 +00:00
bevy_audio don't depend directly on oboe (#12316) 2024-03-05 17:23:12 +00:00
bevy_color Fix green colors becoming darker in various examples (#12328) 2024-03-05 23:42:03 +00:00
bevy_core Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_core_pipeline Improve Bloom 3D lighting (#11981) 2024-03-07 15:20:38 +00:00
bevy_derive Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_dev_tools Add bevy_dev_tools crate (#11341) 2024-03-06 20:33:05 +00:00
bevy_diagnostic Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_dylib Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_dynamic_plugin Document all members of bevy_dynamic_plugin (#12029) 2024-02-22 13:28:52 +00:00
bevy_ecs Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_ecs_compile_fail_tests Remove APIs deprecated in 0.13 (#11974) 2024-02-19 19:04:47 +00:00
bevy_encase_derive Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_gilrs Replace bevy_log's tracing reexport with bevy_utils' (#12254) 2024-03-02 18:38:04 +00:00
bevy_gizmos Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_gltf Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_hierarchy Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_input Clean up type registrations (#12314) 2024-03-06 16:05:53 +00:00
bevy_internal Add bevy_dev_tools crate (#11341) 2024-03-06 20:33:05 +00:00
bevy_log Add access to App within LogPlugin::update_subscriber (#12045) 2024-03-04 00:01:05 +00:00
bevy_macro_utils fix some typos (#12038) 2024-02-22 18:55:22 +00:00
bevy_macros_compile_fail_tests Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_math Add note about rotations for Aabb3d (#12315) 2024-03-05 17:22:53 +00:00
bevy_mikktspace fix some typos (#12038) 2024-02-22 18:55:22 +00:00
bevy_pbr Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_ptr Clean up pointer use in BundleSpawner/BundleInserter (#12269) 2024-03-06 05:52:18 +00:00
bevy_reflect Implement the AnimationGraph, allowing for multiple animations to be blended together. (#11989) 2024-03-07 20:22:42 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Recursive registration (#5781) 2024-03-04 19:04:10 +00:00
bevy_render Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_scene Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
bevy_sprite Fix docs for atlas + slicing support (#12325) 2024-03-05 18:04:22 +00:00
bevy_tasks remove repetitive code (#12270) 2024-03-03 07:58:22 +00:00
bevy_text Clean up type registrations (#12314) 2024-03-06 16:05:53 +00:00
bevy_time Add bevy_dev_tools crate (#11341) 2024-03-06 20:33:05 +00:00
bevy_transform Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
bevy_ui Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_utils Disentangle bevy_utils/bevy_core's reexported dependencies (#12313) 2024-03-07 02:30:15 +00:00
bevy_window Clean up type registrations (#12314) 2024-03-06 16:05:53 +00:00
bevy_winit Fix winit control flow when re-focusing game (#12239) 2024-03-04 19:15:05 +00:00