Skip to content

Commit a0a5a79

Browse files
authored
Migrate to bevy 0.18 (#116)
1 parent 339f814 commit a0a5a79

29 files changed

Lines changed: 472 additions & 393 deletions

File tree

Cargo.lock

Lines changed: 375 additions & 282 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@ members = ["crates/*", "examples/*"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.9.0"
6+
version = "0.10.0"
77
license = "MIT OR Apache-2.0"
88
readme = "README.md"
99
edition = "2024"
1010
repository = "https://github.com/mbrea-c/bevy_animation_graph"
1111

1212
[workspace.dependencies]
13-
bevy_animation_graph_proc_macros = { version = "0.9.0", path = "./crates/bevy_animation_graph_proc_macros" }
14-
bevy_animation_graph = { version = "0.9.0", path = "./crates/bevy_animation_graph" }
15-
bevy_animation_graph_core = { version = "0.9.0", path = "./crates/bevy_animation_graph_core" }
16-
bevy_animation_graph_builtin_nodes = { version = "0.9.0", path = "./crates/bevy_animation_graph_builtin_nodes" }
13+
bevy_animation_graph_proc_macros = { version = "0.10.0", path = "./crates/bevy_animation_graph_proc_macros" }
14+
bevy_animation_graph = { version = "0.10.0", path = "./crates/bevy_animation_graph" }
15+
bevy_animation_graph_core = { version = "0.10.0", path = "./crates/bevy_animation_graph_core" }
16+
bevy_animation_graph_builtin_nodes = { version = "0.10.0", path = "./crates/bevy_animation_graph_builtin_nodes" }
17+
18+
bevy = { version = "0.18" }
19+
avian3d = { version = "0.5" }
20+
21+
egui_dock = "0.18"
22+
egui-notify = { version = "0.21" }
23+
egui = { version = "0.33" }
24+
egui_extras = { version = "0.33", features = ["all_loaders"] }
25+
bevy_egui = { version = "0.39" }
26+
bevy-inspector-egui = { version = "0.36" }
1727

18-
bevy = { version = "0.17" }
19-
avian3d = { version = "0.4" }
2028
ron = "0.10.1"
2129
serde = { version = "1.0" }

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ pinging me in the Bevy discord.
182182

183183
| `bevy` | `bevy_animation_graph` |
184184
| ------ | ---------------------- |
185-
| 0.17 | master |
185+
| 0.18 | master |
186+
| 0.18 | 0.10 |
186187
| 0.17 | 0.9 |
187188
| 0.17 | 0.8 |
188189
| 0.16 | 0.7 |

crates/bevy_animation_graph_core/src/animated_scene/loader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use bevy::{
22
asset::{AssetLoader, AssetPath, Handle, LoadContext, io::Reader},
33
platform::collections::HashMap,
4+
reflect::TypePath,
45
scene::Scene,
56
};
67
use serde::{Deserialize, Serialize};
@@ -30,7 +31,7 @@ pub struct RetargetingSerial {
3031
bone_path_overrides: HashMap<String, String>,
3132
}
3233

33-
#[derive(Default)]
34+
#[derive(Default, TypePath)]
3435
pub struct AnimatedSceneLoader;
3536

3637
impl AssetLoader for AnimatedSceneLoader {

crates/bevy_animation_graph_core/src/animated_scene/mod.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub mod loader;
22

33
use bevy::{
4-
animation::AnimationTarget,
54
asset::{Asset, Assets, Handle, ReflectAsset},
65
camera::visibility::Visibility,
76
ecs::{
@@ -171,23 +170,23 @@ fn process_scene_into_animscn(
171170
{
172171
let player_entity_id = entity_mut.id();
173172

174-
let mut query = scene.world.query::<&mut AnimationTarget>();
173+
let mut query = scene.world.query::<(
174+
&mut bevy::animation::AnimationTargetId,
175+
&bevy::animation::AnimatedBy,
176+
)>();
175177

176-
for mut target in query.iter_mut(&mut scene.world) {
177-
if player_entity_id != target.player {
178+
for (mut target_id, animated_by) in query.iter_mut(&mut scene.world) {
179+
if player_entity_id != animated_by.0 {
178180
continue;
179181
}
180182

181-
let bone_id = BoneId::from(target.id);
183+
let bone_id = BoneId::from(*target_id);
182184
let Some(mapped_bone_id) =
183185
apply_bone_path_overrides(bone_id, skeleton, &retargeting.bone_path_overrides)
184186
else {
185187
continue;
186188
};
187-
*target = AnimationTarget {
188-
id: bevy::animation::AnimationTargetId(mapped_bone_id.id()),
189-
player: target.player,
190-
}
189+
*target_id = bevy::animation::AnimationTargetId(mapped_bone_id.id());
191190
}
192191
}
193192

crates/bevy_animation_graph_core/src/animation_clip/loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use bevy::{
22
asset::{AssetLoader, AssetPath, LoadContext, io::Reader},
33
gltf::Gltf,
44
platform::collections::HashMap,
5-
reflect::Reflect,
5+
reflect::{Reflect, TypePath},
66
};
77
use serde::{Deserialize, Serialize};
88

@@ -25,7 +25,7 @@ pub struct GraphClipSerial {
2525
pub event_tracks: HashMap<String, EventTrack>,
2626
}
2727

28-
#[derive(Default)]
28+
#[derive(Default, TypePath)]
2929
pub struct GraphClipLoader;
3030

3131
impl AssetLoader for GraphClipLoader {

crates/bevy_animation_graph_core/src/animation_graph/loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use bevy::{
44
reflect::AppTypeRegistry,
55
world::{FromWorld, World},
66
},
7-
reflect::TypeRegistryArc,
7+
reflect::{TypePath, TypeRegistryArc},
88
};
99

1010
use crate::{
1111
animation_graph::{AnimationGraph, serial::AnimationGraphDeserializer},
1212
errors::AssetLoaderError,
1313
};
1414

15-
#[derive(Debug, Clone)]
15+
#[derive(Debug, Clone, TypePath)]
1616
pub struct AnimationGraphLoader {
1717
type_registry: TypeRegistryArc,
1818
}

crates/bevy_animation_graph_core/src/ragdoll/bone_mapping_loader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bevy::{
22
asset::{AssetLoader, AssetPath, LoadContext, io::Reader},
33
platform::collections::HashMap,
4-
reflect::Reflect,
4+
reflect::{Reflect, TypePath},
55
};
66
use serde::{Deserialize, Serialize};
77

@@ -15,7 +15,7 @@ use crate::{
1515
symmetry::serial::SymmetryConfigSerial,
1616
};
1717

18-
#[derive(Default)]
18+
#[derive(Default, TypePath)]
1919
pub struct RagdollBoneMapLoader;
2020

2121
impl AssetLoader for RagdollBoneMapLoader {

crates/bevy_animation_graph_core/src/ragdoll/definition_loader.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
use bevy::asset::{AssetLoader, LoadContext, io::Reader};
1+
use bevy::{
2+
asset::{AssetLoader, LoadContext, io::Reader},
3+
reflect::TypePath,
4+
};
25

36
use crate::{errors::AssetLoaderError, ragdoll::definition::Ragdoll};
47

5-
#[derive(Default)]
8+
#[derive(Default, TypePath)]
69
pub struct RagdollLoader;
710

811
impl AssetLoader for RagdollLoader {

crates/bevy_animation_graph_core/src/skeleton/loader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use bevy::{
44
ecs::{hierarchy::Children, name::Name},
55
gltf::Gltf,
66
prelude::{Entity, With, World},
7+
reflect::TypePath,
78
scene::Scene,
89
transform::components::Transform,
910
};
@@ -14,7 +15,7 @@ use super::{
1415
};
1516
use crate::{animation_clip::EntityPath, errors::AssetLoaderError};
1617

17-
#[derive(Default)]
18+
#[derive(Default, TypePath)]
1819
pub struct SkeletonLoader;
1920

2021
impl AssetLoader for SkeletonLoader {

0 commit comments

Comments
 (0)