Skip to content

Commit

Permalink
feature gate use bevy_animation in bevy_gltf (bevyengine#15424)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
atornity authored Sep 26, 2024
1 parent e34a56c commit 5fcbdc1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit 5fcbdc1

Please sign in to comment.