Skip to content

Commit 285cd46

Browse files
committed
Change approach, find entities in scene.
1 parent 21e015f commit 285cd46

File tree

8 files changed

+210
-274
lines changed

8 files changed

+210
-274
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/gltf/Duck.glb

-68 Bytes
Binary file not shown.

crates/processing_pyo3/src/gltf.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::material::Material;
88
#[pyclass(unsendable)]
99
pub struct Gltf {
1010
entity: Entity,
11-
graphics_entity: Entity,
1211
}
1312

1413
#[pymethods]
@@ -34,12 +33,12 @@ impl Gltf {
3433
}
3534

3635
pub fn camera(&self, index: usize) -> PyResult<()> {
37-
gltf_camera(self.entity, self.graphics_entity, index)
36+
gltf_camera(self.entity, index)
3837
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))
3938
}
4039

4140
pub fn light(&self, index: usize) -> PyResult<Light> {
42-
let entity = gltf_light(self.entity, self.graphics_entity, index)
41+
let entity = gltf_light(self.entity, index)
4342
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
4443
Ok(Light { entity })
4544
}
@@ -49,9 +48,7 @@ impl Gltf {
4948
#[pyo3(pass_module)]
5049
pub fn load_gltf(module: &Bound<'_, PyModule>, path: &str) -> PyResult<Gltf> {
5150
let graphics = get_graphics(module)?;
52-
let entity = gltf_load(path).map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
53-
Ok(Gltf {
54-
entity,
55-
graphics_entity: graphics.entity,
56-
})
51+
let entity = gltf_load(graphics.entity, path)
52+
.map_err(|e| PyRuntimeError::new_err(format!("{e}")))?;
53+
Ok(Gltf { entity })
5754
}

crates/processing_render/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ x11 = ["bevy/x11"]
1313

1414
[dependencies]
1515
bevy = { workspace = true }
16-
gltf = { version = "1.4.0", default-features = false, features = ["KHR_lights_punctual", "names"] }
1716
lyon = "1.0"
1817
raw-window-handle = "0.6"
1918
thiserror = "2"

0 commit comments

Comments
 (0)