From 5fcbdc137a6e3e636aef3e5fd9190b0bc6ec2887 Mon Sep 17 00:00:00 2001 From: poopy Date: Thu, 26 Sep 2024 15:40:24 +0200 Subject: [PATCH] feature gate `use bevy_animation` in `bevy_gltf` (#15424) # Objective `bevy_gltf` have an instance where `use bevy_animation` is not behind `#[cfg(feature = "bevy_animation")]`. This resulted in a compile error when the feature is not enabled: `failed to resolve: use of undeclared crate or module 'bevy_animation'`. ## Solution move this instance of `use bevy_animation` behind the `cfg` attribute. ## Testing I no longer get the error when compiling without the feature. --- crates/bevy_gltf/src/loader.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index e9ca9562da..f732422378 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -3,11 +3,13 @@ use crate::{ GltfMeshExtras, GltfNode, GltfSceneExtras, GltfSkin, }; -use bevy_animation::prelude::{ - Keyframes, MorphWeightsKeyframes, RotationKeyframes, ScaleKeyframes, TranslationKeyframes, -}; #[cfg(feature = "bevy_animation")] -use bevy_animation::{AnimationTarget, AnimationTargetId}; +use bevy_animation::{ + keyframes::{ + Keyframes, MorphWeightsKeyframes, RotationKeyframes, ScaleKeyframes, TranslationKeyframes, + }, + AnimationTarget, AnimationTargetId, +}; use bevy_asset::{ io::Reader, AssetLoadError, AssetLoader, Handle, LoadContext, ReadAssetBytesError, };