From 6f180b66f5b63e1985dcfb01f3c0c3b911cf1677 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Sat, 9 Aug 2025 03:58:23 -0400 Subject: [PATCH] Make bevy_animation not depend on bevy_render --- crates/bevy_animation/Cargo.toml | 1 - crates/bevy_animation/src/lib.rs | 2 +- crates/bevy_mesh/src/lib.rs | 5 +++++ crates/bevy_render/src/mesh/mod.rs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/bevy_animation/Cargo.toml b/crates/bevy_animation/Cargo.toml index 731a6c7c4f83a..ec3d91956ce38 100644 --- a/crates/bevy_animation/Cargo.toml +++ b/crates/bevy_animation/Cargo.toml @@ -19,7 +19,6 @@ bevy_mesh = { path = "../bevy_mesh", version = "0.17.0-dev" } bevy_reflect = { path = "../bevy_reflect", version = "0.17.0-dev", features = [ "petgraph", ] } -bevy_render = { path = "../bevy_render", version = "0.17.0-dev" } bevy_time = { path = "../bevy_time", version = "0.17.0-dev" } bevy_utils = { path = "../bevy_utils", version = "0.17.0-dev" } bevy_ecs = { path = "../bevy_ecs", version = "0.17.0-dev" } diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 3c9c7d9e4c3f1..a848ee47f8d2f 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -1245,7 +1245,7 @@ impl Plugin for AnimationPlugin { // `PostUpdate`. For now, we just disable ambiguity testing // for this system. animate_targets - .before(bevy_render::mesh::inherit_weights) + .before(bevy_mesh::InheritWeights) .ambiguous_with_all(), trigger_untargeted_animation_events, expire_completed_transitions, diff --git a/crates/bevy_mesh/src/lib.rs b/crates/bevy_mesh/src/lib.rs index 635e36ead4a19..7607bc3ec3ba7 100644 --- a/crates/bevy_mesh/src/lib.rs +++ b/crates/bevy_mesh/src/lib.rs @@ -12,6 +12,7 @@ pub mod morph; pub mod primitives; pub mod skinning; mod vertex; +use bevy_ecs::schedule::SystemSet; use bitflags::bitflags; pub use components::*; pub use index::*; @@ -57,3 +58,7 @@ impl BaseMeshPipelineKey { } } } + +/// `bevy_render::mesh::inherit_weights` runs in this `SystemSet` +#[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)] +pub struct InheritWeights; diff --git a/crates/bevy_render/src/mesh/mod.rs b/crates/bevy_render/src/mesh/mod.rs index 2f998fbe2fd91..17a48020890b6 100644 --- a/crates/bevy_render/src/mesh/mod.rs +++ b/crates/bevy_render/src/mesh/mod.rs @@ -52,7 +52,7 @@ impl Plugin for MeshPlugin { pub struct MorphPlugin; impl Plugin for MorphPlugin { fn build(&self, app: &mut App) { - app.add_systems(PostUpdate, inherit_weights); + app.add_systems(PostUpdate, inherit_weights.in_set(InheritWeights)); } }