Skip to content

Commit 0b30b6b

Browse files
authored
reduce bevy_gltf dependency on render and pbr (#20390)
# Objective - make bevy_gltf not depend on bevy_render/bevy_pbr ## Solution - use bevy_light and bevy_camera ## Testing - cargo check --examples
1 parent d9361d5 commit 0b30b6b

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

crates/bevy_gltf/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ bevy_color = { path = "../bevy_color", version = "0.17.0-dev" }
2626
bevy_core_pipeline = { path = "../bevy_core_pipeline", version = "0.17.0-dev" }
2727
bevy_ecs = { path = "../bevy_ecs", version = "0.17.0-dev" }
2828
bevy_image = { path = "../bevy_image", version = "0.17.0-dev" }
29+
bevy_light = { path = "../bevy_light", version = "0.17.0-dev" }
30+
bevy_camera = { path = "../bevy_camera", version = "0.17.0-dev" }
2931
bevy_math = { path = "../bevy_math", version = "0.17.0-dev" }
3032
bevy_mesh = { path = "../bevy_mesh", version = "0.17.0-dev" }
3133
bevy_pbr = { path = "../bevy_pbr", version = "0.17.0-dev" }

crates/bevy_gltf/src/loader/mod.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ use bevy_asset::{
1515
io::Reader, AssetLoadError, AssetLoader, Handle, LoadContext, ReadAssetBytesError,
1616
RenderAssetUsages,
1717
};
18+
use bevy_camera::{
19+
primitives::Aabb, visibility::Visibility, Camera, OrthographicProjection,
20+
PerspectiveProjection, Projection, ScalingMode,
21+
};
1822
use bevy_color::{Color, LinearRgba};
1923
use bevy_core_pipeline::prelude::Camera3d;
2024
use bevy_ecs::{
@@ -27,25 +31,18 @@ use bevy_image::{
2731
CompressedImageFormats, Image, ImageLoaderSettings, ImageSampler, ImageSamplerDescriptor,
2832
ImageType, TextureError,
2933
};
34+
use bevy_light::{DirectionalLight, PointLight, SpotLight};
3035
use bevy_math::{Mat4, Vec3};
3136
use bevy_mesh::{
3237
morph::{MeshMorphWeights, MorphAttributes, MorphTargetImage, MorphWeights},
3338
skinning::{SkinnedMesh, SkinnedMeshInverseBindposes},
34-
Indices, Mesh, MeshVertexAttribute, PrimitiveTopology, VertexAttributeValues,
39+
Indices, Mesh, Mesh3d, MeshVertexAttribute, PrimitiveTopology, VertexAttributeValues,
3540
};
3641
#[cfg(feature = "pbr_transmission_textures")]
3742
use bevy_pbr::UvChannel;
38-
use bevy_pbr::{
39-
DirectionalLight, MeshMaterial3d, PointLight, SpotLight, StandardMaterial, MAX_JOINTS,
40-
};
43+
use bevy_pbr::{MeshMaterial3d, StandardMaterial, MAX_JOINTS};
4144
use bevy_platform::collections::{HashMap, HashSet};
42-
use bevy_render::{
43-
camera::{Camera, OrthographicProjection, PerspectiveProjection, Projection, ScalingMode},
44-
mesh::Mesh3d,
45-
primitives::Aabb,
46-
render_resource::Face,
47-
view::Visibility,
48-
};
45+
use bevy_render::render_resource::Face;
4946
use bevy_scene::Scene;
5047
#[cfg(not(target_arch = "wasm32"))]
5148
use bevy_tasks::IoTaskPool;

0 commit comments

Comments
 (0)