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.
This commit is contained in:
poopy 2024-09-26 15:40:24 +02:00 committed by GitHub
parent e34a56c963
commit 5fcbdc137a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
};