Skip to content

Commit

Permalink
Demote the warning to trace since it happens regularly when loading glTF
Browse files Browse the repository at this point in the history
and is harmless, and fix the system order in the examples
  • Loading branch information
pcwalton committed Mar 7, 2024
1 parent 6927108 commit bf9ab8b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
11 changes: 7 additions & 4 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use bevy_time::Time;
use bevy_transform::{prelude::Transform, TransformSystem};
use bevy_utils::hashbrown::HashMap;
use bevy_utils::{
tracing::{error, warn},
tracing::{error, trace},
NoOpHash,
};
use fixedbitset::FixedBitSet;
Expand Down Expand Up @@ -755,9 +755,12 @@ pub fn animate_targets(
.par_iter_mut()
.for_each(|(id, target, name, (transform, morph_weights))| {
let Ok((animation_player, animation_graph_handle)) = players.get(target.player) else {
warn!(
"Couldn't find the animation player {:?} for the target entity {:?} ({:?})",
target.player, id, name,
trace!(
"Either an animation player {:?} or a graph was missing for the target \
entity {:?} ({:?}); no animations will play this frame",
target.player,
id,
name,
);
return;
};
Expand Down
12 changes: 7 additions & 5 deletions examples/animation/animated_fox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
use std::f32::consts::PI;
use std::time::Duration;

use bevy::{animation::RepeatAnimation, pbr::CascadeShadowConfigBuilder, prelude::*};
use bevy::{
animation::{animate_targets, RepeatAnimation},
pbr::CascadeShadowConfigBuilder,
prelude::*,
};

fn main() {
App::new()
Expand All @@ -13,10 +17,8 @@ fn main() {
})
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(
Update,
(setup_scene_once_loaded, keyboard_animation_control),
)
.add_systems(Update, setup_scene_once_loaded.before(animate_targets))
.add_systems(Update, keyboard_animation_control)
.run();
}

Expand Down
3 changes: 2 additions & 1 deletion examples/animation/animation_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use std::{fs::File, path::Path};

use bevy::{
animation::animate_targets,
color::palettes::{
basic::WHITE,
css::{ANTIQUE_WHITE, DARK_GREEN},
Expand Down Expand Up @@ -84,7 +85,7 @@ fn main() {
..default()
}))
.add_systems(Startup, (setup_assets, setup_scene, setup_ui))
.add_systems(PreUpdate, init_animations)
.add_systems(Update, init_animations.before(animate_targets))
.add_systems(
Update,
(handle_weight_drag, update_ui, sync_weights).chain(),
Expand Down

0 comments on commit bf9ab8b

Please sign in to comment.