From e422ed0f951e6633456e259795ecc5c63a2537b0 Mon Sep 17 00:00:00 2001 From: atlas dostal Date: Sat, 2 Aug 2025 20:39:01 -0400 Subject: [PATCH] reduce bevy_gltf dependency on render and pbr --- crates/bevy_gltf/Cargo.toml | 2 ++ crates/bevy_gltf/src/loader/mod.rs | 19 ++++++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/crates/bevy_gltf/Cargo.toml b/crates/bevy_gltf/Cargo.toml index 7c4216d8897f2..15149139ae396 100644 --- a/crates/bevy_gltf/Cargo.toml +++ b/crates/bevy_gltf/Cargo.toml @@ -26,6 +26,8 @@ bevy_color = { path = "../bevy_color", version = "0.17.0-dev" } bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.17.0-dev" } bevy_ecs = { path = "../bevy_ecs", version = "0.17.0-dev" } bevy_image = { path = "../bevy_image", version = "0.17.0-dev" } +bevy_light = { path = "../bevy_light", version = "0.17.0-dev" } +bevy_camera = { path = "../bevy_camera", version = "0.17.0-dev" } bevy_math = { path = "../bevy_math", version = "0.17.0-dev" } bevy_mesh = { path = "../bevy_mesh", version = "0.17.0-dev" } bevy_pbr = { path = "../bevy_pbr", version = "0.17.0-dev" } diff --git a/crates/bevy_gltf/src/loader/mod.rs b/crates/bevy_gltf/src/loader/mod.rs index 9597f8699bb84..15047cf41062e 100644 --- a/crates/bevy_gltf/src/loader/mod.rs +++ b/crates/bevy_gltf/src/loader/mod.rs @@ -15,6 +15,10 @@ use bevy_asset::{ io::Reader, AssetLoadError, AssetLoader, Handle, LoadContext, ReadAssetBytesError, RenderAssetUsages, }; +use bevy_camera::{ + primitives::Aabb, visibility::Visibility, Camera, OrthographicProjection, + PerspectiveProjection, Projection, ScalingMode, +}; use bevy_color::{Color, LinearRgba}; use bevy_core_pipeline::prelude::Camera3d; use bevy_ecs::{ @@ -27,25 +31,18 @@ use bevy_image::{ CompressedImageFormats, Image, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor, ImageType, TextureError, }; +use bevy_light::{DirectionalLight, PointLight, SpotLight}; use bevy_math::{Mat4, Vec3}; use bevy_mesh::{ morph::{MeshMorphWeights, MorphAttributes, MorphTargetImage, MorphWeights}, skinning::{SkinnedMesh, SkinnedMeshInverseBindposes}, - Indices, Mesh, MeshVertexAttribute, PrimitiveTopology, VertexAttributeValues, + Indices, Mesh, Mesh3d, MeshVertexAttribute, PrimitiveTopology, VertexAttributeValues, }; #[cfg(feature = "pbr_transmission_textures")] use bevy_pbr::UvChannel; -use bevy_pbr::{ - DirectionalLight, MeshMaterial3d, PointLight, SpotLight, StandardMaterial, MAX_JOINTS, -}; +use bevy_pbr::{MeshMaterial3d, StandardMaterial, MAX_JOINTS}; use bevy_platform::collections::{HashMap, HashSet}; -use bevy_render::{ - camera::{Camera, OrthographicProjection, PerspectiveProjection, Projection, ScalingMode}, - mesh::Mesh3d, - primitives::Aabb, - render_resource::Face, - view::Visibility, -}; +use bevy_render::render_resource::Face; use bevy_scene::Scene; #[cfg(not(target_arch = "wasm32"))] use bevy_tasks::IoTaskPool;