diff --git a/crates/bevy_gltf/Cargo.toml b/crates/bevy_gltf/Cargo.toml index d55b477efeb19..ca79831f5b8fa 100644 --- a/crates/bevy_gltf/Cargo.toml +++ b/crates/bevy_gltf/Cargo.toml @@ -22,7 +22,7 @@ bevy_math = { path = "../bevy_math", version = "0.11.0-dev" } bevy_pbr = { path = "../bevy_pbr", version = "0.11.0-dev" } bevy_reflect = { path = "../bevy_reflect", version = "0.11.0-dev", features = ["bevy"] } bevy_render = { path = "../bevy_render", version = "0.11.0-dev" } -bevy_scene = { path = "../bevy_scene", version = "0.11.0-dev" } +bevy_scene = { path = "../bevy_scene", version = "0.11.0-dev", features = ["bevy_render"] } bevy_transform = { path = "../bevy_transform", version = "0.11.0-dev" } bevy_tasks = { path = "../bevy_tasks", version = "0.11.0-dev" } bevy_utils = { path = "../bevy_utils", version = "0.11.0-dev" } diff --git a/crates/bevy_internal/Cargo.toml b/crates/bevy_internal/Cargo.toml index 2c4439b1be34a..fea2205f39a18 100644 --- a/crates/bevy_internal/Cargo.toml +++ b/crates/bevy_internal/Cargo.toml @@ -92,6 +92,7 @@ accesskit_unix = ["bevy_winit/accesskit_unix"] bevy_text = ["dep:bevy_text", "bevy_ui?/bevy_text"] +bevy_render = ["dep:bevy_render", "bevy_scene?/bevy_render"] # Enable assertions to check the validity of parameters passed to glam glam_assert = ["bevy_math/glam_assert"] diff --git a/crates/bevy_scene/Cargo.toml b/crates/bevy_scene/Cargo.toml index 4ff56f014b7f2..86a40b7ed75a2 100644 --- a/crates/bevy_scene/Cargo.toml +++ b/crates/bevy_scene/Cargo.toml @@ -22,7 +22,7 @@ bevy_reflect = { path = "../bevy_reflect", version = "0.11.0-dev", features = [" bevy_hierarchy = { path = "../bevy_hierarchy", version = "0.11.0-dev" } bevy_transform = { path = "../bevy_transform", version = "0.11.0-dev" } bevy_utils = { path = "../bevy_utils", version = "0.11.0-dev" } -bevy_render = { path = "../bevy_render", version = "0.11.0-dev" } +bevy_render = { path = "../bevy_render", version = "0.11.0-dev", optional = true } # other serde = { version = "1.0", features = ["derive"], optional = true } diff --git a/crates/bevy_scene/src/bundle.rs b/crates/bevy_scene/src/bundle.rs index e29498b02486c..1e66e5729325a 100644 --- a/crates/bevy_scene/src/bundle.rs +++ b/crates/bevy_scene/src/bundle.rs @@ -7,6 +7,7 @@ use bevy_ecs::{ prelude::{Changed, Component, Without}, system::{Commands, Query}, }; +#[cfg(feature = "bevy_render")] use bevy_render::prelude::{ComputedVisibility, Visibility}; use bevy_transform::components::{GlobalTransform, Transform}; @@ -27,7 +28,10 @@ pub struct SceneBundle { pub scene: Handle, pub transform: Transform, pub global_transform: GlobalTransform, + + #[cfg(feature = "bevy_render")] pub visibility: Visibility, + #[cfg(feature = "bevy_render")] pub computed_visibility: ComputedVisibility, } @@ -41,7 +45,10 @@ pub struct DynamicSceneBundle { pub scene: Handle, pub transform: Transform, pub global_transform: GlobalTransform, + + #[cfg(feature = "bevy_render")] pub visibility: Visibility, + #[cfg(feature = "bevy_render")] pub computed_visibility: ComputedVisibility, } diff --git a/crates/bevy_scene/src/scene_loader.rs b/crates/bevy_scene/src/scene_loader.rs index ed5c82443cc0f..ddffbebce454c 100644 --- a/crates/bevy_scene/src/scene_loader.rs +++ b/crates/bevy_scene/src/scene_loader.rs @@ -1,3 +1,4 @@ +#[cfg(feature = "serialize")] use crate::serde::SceneDeserializer; use anyhow::{anyhow, Result}; use bevy_app::AppTypeRegistry;