diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-09 22:30:46 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-09 22:30:46 +0100 |
commit | 1aca139c985cb71be90da1de6d65adc3c7d0d073 (patch) | |
tree | f271d3fddcd05897a0cbfdca0e134233f213b6f4 /world/src/main.rs | |
parent | ecaa6a08527bad93c71bdb8211b6c2f8232ff878 (diff) | |
download | weareserver-1aca139c985cb71be90da1de6d65adc3c7d0d073.tar weareserver-1aca139c985cb71be90da1de6d65adc3c7d0d073.tar.bz2 weareserver-1aca139c985cb71be90da1de6d65adc3c7d0d073.tar.zst |
KHR_materials_unlit
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index 7f531b4..af32222 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -19,7 +19,7 @@ pub mod mesh; use anyhow::{Result, bail}; use clap::Parser; -use gltf::image::Source; +use gltf::{Gltf, image::Source, import_buffers}; use image::{ImageReader, codecs::webp::WebPEncoder}; use log::info; use mesh::import_mesh; @@ -78,10 +78,21 @@ fn main() -> Result<()> { Packet::Connect(random()).write(&mut sock)?; - let (gltf, buffers, _) = gltf::import(&args.scene)?; + // let (gltf, buffers, _) = gltf::import(&args.scene)?; let path_base = args.scene.parent().unwrap(); + let gltf = Gltf::from_reader_without_validation(File::open(&args.scene)?)?; + + let buffers = import_buffers(&gltf, Some(path_base), None)?; + let mut prefab = Prefab::default(); + + prefab.name = gltf + .default_scene() + .map(|n| n.name()) + .flatten() + .map(|n| n.to_owned()); + for node in gltf.nodes() { if let Some(mesh) = node.mesh() { import_mesh( |