fix bevy_gltf crate build (#13202)

# Objective

Fixing `bevy_gltf` crate build fail when `bevy_animation` feature is
disabled

## Solution

Add missing `bevy_animation` feature
This commit is contained in:
Ycy 2024-05-03 21:00:18 +08:00 committed by GitHub
parent b9455afd0c
commit 9d8f94d461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -9,8 +9,8 @@ license = "MIT OR Apache-2.0"
keywords = ["bevy"]
[features]
dds = []
pbr_transmission_textures = []
dds = ["bevy_render/dds"]
pbr_transmission_textures = ["bevy_pbr/pbr_transmission_textures"]
[dependencies]
# bevy

View file

@ -605,7 +605,9 @@ async fn load_gltf<'a, 'b, 'c>(
&mut entity_to_skin_index_map,
&mut active_camera_found,
&Transform::default(),
#[cfg(feature = "bevy_animation")]
&animation_roots,
#[cfg(feature = "bevy_animation")]
None,
);
if result.is_err() {
@ -1011,8 +1013,8 @@ fn load_node(
entity_to_skin_index_map: &mut EntityHashMap<usize>,
active_camera_found: &mut bool,
parent_transform: &Transform,
animation_roots: &HashSet<usize>,
mut animation_context: Option<AnimationContext>,
#[cfg(feature = "bevy_animation")] animation_roots: &HashSet<usize>,
#[cfg(feature = "bevy_animation")] mut animation_context: Option<AnimationContext>,
) -> Result<(), GltfError> {
let mut gltf_error = None;
let transform = node_transform(gltf_node);
@ -1261,7 +1263,9 @@ fn load_node(
entity_to_skin_index_map,
active_camera_found,
&world_transform,
#[cfg(feature = "bevy_animation")]
animation_roots,
#[cfg(feature = "bevy_animation")]
animation_context.clone(),
) {
gltf_error = Some(err);
@ -1632,10 +1636,6 @@ struct AnimationContext {
path: SmallVec<[Name; 8]>,
}
#[cfg(not(feature = "bevy_animation"))]
#[derive(Clone)]
struct AnimationContext;
#[cfg(test)]
mod test {
use std::path::PathBuf;