diff --git a/Cargo.lock b/Cargo.lock index fe0be48..63ff0b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2388,12 +2388,9 @@ dependencies = [ [[package]] name = "field_path" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b15fe157f96af46037f9135145fd540de8a93cf4a32e8d7ba0037796878208a" -dependencies = [ - "hashbrown 0.16.1", -] +checksum = "36ccac07e4c62197b44fd7161abc6bf6b006c8dc725aeca40fd438e62d0f2ada" [[package]] name = "find-msvc-tools" diff --git a/Cargo.toml b/Cargo.toml index 0c0a181..23ab599 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ bevy_sprite = { version = "0.18.1", default-features = false } bevy_pbr = { version = "0.18.1", default-features = false } # other -field_path = "0.3" +field_path = "0.4.1" nonempty = { version = "0.12", default-features = false } [workspace.lints.clippy] diff --git a/crates/bevy_motiongfx/README.md b/crates/bevy_motiongfx/README.md index 0fb085d..08362a6 100644 --- a/crates/bevy_motiongfx/README.md +++ b/crates/bevy_motiongfx/README.md @@ -40,7 +40,7 @@ use bevy_motiongfx::prelude::*; fn build_timeline( mut commands: Commands, - mut motiongfx: ResMut, + mut motiongfx: ResMut, ) { // Spawn the Entity. let entity = commands @@ -48,9 +48,9 @@ fn build_timeline( .id(); // Build the timeline. - let mut b = TimelineBuilder::new(); + let mut b = motiongfx.create_builder(); let track = b - .act_interp(entity, field!(::translation::x), |x| { + .act_interp(entity, path!(::translation::x), |x| { x + 6.0 }) .play(1.0) @@ -72,7 +72,7 @@ use bevy_motiongfx::prelude::*; fn build_timeline( mut commands: Commands, - mut motiongfx: ResMut, + mut motiongfx: ResMut, mut materials: ResMut> ) { // Create the asset. @@ -82,12 +82,12 @@ fn build_timeline( commands.spawn(MeshMaterial3d(material.clone())); // Build the timeline. - let mut b = TimelineBuilder::new(); + let mut b = motiongfx.create_builder(); let track = b .act_interp( // AssetIds must be type-erased. material.untyped().id(), - field!(::base_color), + path!(::base_color), |_| Srgba::RED.into(), ) .play(1.0) @@ -112,10 +112,10 @@ use bevy_motiongfx::prelude::*; fn build_timeline( mut commands: Commands, - mut motiongfx: ResMut, + mut motiongfx: ResMut, ) { // Build the timeline. - let mut b = TimelineBuilder::new(); + let mut b = motiongfx.create_builder(); // Add tracks here... let timeline = b.compile(); diff --git a/crates/bevy_motiongfx/src/controller.rs b/crates/bevy_motiongfx/src/controller.rs index 8b09b3e..50fe4a0 100644 --- a/crates/bevy_motiongfx/src/controller.rs +++ b/crates/bevy_motiongfx/src/controller.rs @@ -3,7 +3,7 @@ use bevy_ecs::prelude::*; use bevy_time::prelude::*; use crate::MotionGfxSet; -use crate::world::{MotionGfxWorld, TimelineId}; +use crate::manager::{MotionGfxManager, TimelineId}; pub struct ControllerPlugin; @@ -18,7 +18,7 @@ impl Plugin for ControllerPlugin { } fn realtime_player_timing( - mut motiongfx: ResMut, + mut motiongfx: ResMut, q_timelines: Query<(&TimelineId, &RealtimePlayer)>, time: Res