diff --git a/Cargo.lock b/Cargo.lock index ecd0fcf17..469c23aa0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3724,9 +3724,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tobj" -version = "3.2.5" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57381207291289bad19de63acd3fbf5948ff99b2868116c367b7224c37d55f90" +checksum = "b450e3ba06251ec4fc76917dafeaf55805ffb26dbf7d5500bfb9511ce63a0d1f" dependencies = [ "ahash 0.8.3", ] diff --git a/crates/fj-viewer/Cargo.toml b/crates/fj-viewer/Cargo.toml index 03930fcf8..cb87b8a3e 100644 --- a/crates/fj-viewer/Cargo.toml +++ b/crates/fj-viewer/Cargo.toml @@ -18,7 +18,7 @@ egui-wgpu = "0.21.0" fj-interop.workspace = true fj-math.workspace = true nalgebra = "0.32.2" -tobj = "3.2.5" +tobj = "4.0.0" raw-window-handle = "0.5.2" thiserror = "1.0.40" tracing = "0.1.37" diff --git a/crates/fj-viewer/src/graphics/model.rs b/crates/fj-viewer/src/graphics/model.rs index c5f07edbe..d0c9c77fd 100644 --- a/crates/fj-viewer/src/graphics/model.rs +++ b/crates/fj-viewer/src/graphics/model.rs @@ -95,7 +95,10 @@ pub fn load_model( let mut materials = Vec::new(); for m in obj_materials? { - let texture_data: &[u8] = assets.get_asset(m.diffuse_texture.as_str()); + let texture_data: &[u8] = match m.diffuse_texture { + Some(diffuse_texture) => assets.get_asset(diffuse_texture.as_str()), + None => continue, + }; let diffuse_texture = texture::Texture::from_bytes( device,