summaryrefslogtreecommitdiff
path: root/world
diff options
context:
space:
mode:
Diffstat (limited to 'world')
-rw-r--r--world/src/main.rs1
-rw-r--r--world/src/mesh.rs12
2 files changed, 11 insertions, 2 deletions
diff --git a/world/src/main.rs b/world/src/main.rs
index a31ef63..b5ce1a4 100644
--- a/world/src/main.rs
+++ b/world/src/main.rs
@@ -178,6 +178,7 @@ fn main() -> Result<()> {
&mut prefab,
&args,
&texture_cache,
+ &armatures,
)?;
}
let (position, _, _) = node.transform().decomposed();
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,