Skip to content

Commit

Permalink
animation player (bevyengine#4375)
Browse files Browse the repository at this point in the history
# Objective

- Add a basic animation player
  - Single track
  - Not generic, can only animate `Transform`s
  - With plenty of possible optimisations available
  - Close-ish to bevyengine/rfcs#49
- https://discord.com/channels/691052431525675048/774027865020039209/958820063148929064

## Solution

- Can play animations
  - looping or not
- Can pause animations
- Can seek in animation
- Can alter speed of animation
- I also removed the previous gltf animation example

https://user-images.githubusercontent.com/8672791/161051887-e79283f0-9803-448a-93d0-5f7a62acb02d.mp4
  • Loading branch information
mockersf authored and aevyrie committed Jun 7, 2022
1 parent ec4e394 commit 3417726
Show file tree
Hide file tree
Showing 18 changed files with 582 additions and 1,414 deletions.
5 changes: 3 additions & 2 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
* Ground tile from [Kenney's Tower Defense Kit](https://www.kenney.nl/assets/tower-defense-kit) (CC0 1.0 Universal)
* Game icons from [Kenney's Game Icons](https://www.kenney.nl/assets/game-icons) (CC0 1.0 Universal)
* Space ships from [Kenny's Simple Space Kit](https://www.kenney.nl/assets/simple-space) (CC0 1.0 Universal)
* glTF animated triangle from [glTF Sample Models](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/AnimatedTriangle) (CC0 1.0 Universal)
* glTF box animated from [glTF Sample Models](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/BoxAnimated) ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) - by [Cesium](https://cesium.com))
* glTF animated fox from [glTF Sample Models](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Fox)
* Low poly fox [by PixelMannen](https://opengameart.org/content/fox-and-shiba) (CC0 1.0 Universal)
* Rigging and animation [by @tomkranis on Sketchfab](https://sketchfab.com/models/371dea88d7e04a76af5763f2a36866bc) ([CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/))
13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ members = ["crates/*", "examples/ios", "tools/ci", "errors"]

[features]
default = [
"animation",
"bevy_audio",
"bevy_gilrs",
"bevy_winit",
Expand All @@ -43,6 +44,7 @@ render = [
]

# Optional bevy crates
bevy_animation = ["bevy_internal/bevy_animation"]
bevy_audio = ["bevy_internal/bevy_audio"]
bevy_core_pipeline = ["bevy_internal/bevy_core_pipeline"]
bevy_dynamic_plugin = ["bevy_internal/bevy_dynamic_plugin"]
Expand Down Expand Up @@ -98,6 +100,9 @@ bevy_ci_testing = ["bevy_internal/bevy_ci_testing"]
# Enable the "debug asset server" for hot reloading internal assets
debug_asset_server = ["bevy_internal/debug_asset_server"]

# Enable animation support, and glTF animation loading
animation = ["bevy_internal/animation"]

[dependencies]
bevy_dylib = { path = "crates/bevy_dylib", version = "0.7.0-dev", default-features = false, optional = true }
bevy_internal = { path = "crates/bevy_internal", version = "0.7.0-dev", default-features = false }
Expand Down Expand Up @@ -183,10 +188,6 @@ path = "examples/3d/lighting.rs"
name = "load_gltf"
path = "examples/3d/load_gltf.rs"

[[example]]
name = "manual_gltf_animation_player"
path = "examples/3d/manual_gltf_animation_player.rs"

[[example]]
name = "many_cubes"
path = "examples/3d/many_cubes.rs"
Expand Down Expand Up @@ -236,6 +237,10 @@ name = "wireframe"
path = "examples/3d/wireframe.rs"

# Animation
[[example]]
name = "animated_fox"
path = "examples/animation/animated_fox.rs"

[[example]]
name = "custom_skinned_mesh"
path = "examples/animation/custom_skinned_mesh.rs"
Expand Down
118 changes: 0 additions & 118 deletions assets/models/animated/AnimatedTriangle.gltf

This file was deleted.

Loading

0 comments on commit 3417726

Please sign in to comment.