From 12bf2f3302efc9042f12ca17104928c35700c229 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 21 Jan 2025 22:00:39 +0100 Subject: split shaders to individual files --- world/src/mesh.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'world/src/mesh.rs') diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 1b25cbe..3d71939 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -21,7 +21,7 @@ use log::{debug, info}; use std::path::Path; use weareshared::{ Affine3A, Vec3A, - resources::{MeshPart, Prefab}, + resources::{Armature, MeshPart, Prefab}, store::ResourceStore, vec2, vec3a, }; @@ -36,6 +36,7 @@ pub fn import_mesh( prefab: &mut Prefab, args: &Args, texture_cache: &TextureCache, + armatures: &[Option], ) -> Result<()> { Ok(for p in mesh.primitives() { let name = mesh.name().or(node.name()).map(|e| e.to_owned()); @@ -340,10 +341,17 @@ pub fn import_mesh( None }; + let mut armature = None; + if let Some(skin) = node.skin() { + if let Some(a) = &armatures[skin.index()] { + armature = Some(store.set(a)?); + } + } + let mesh = store.set(&MeshPart { name, index, - armature: None, + armature, g_albedo, g_alpha, g_metallic, -- cgit v1.2.3-70-g09d2