diff options
Diffstat (limited to 'world/src/mesh.rs')
-rw-r--r-- | world/src/mesh.rs | 12 |
1 files changed, 10 insertions, 2 deletions
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<Armature>], ) -> 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, |