From 81a191e702abcf77b73b9163ce43c4527a01ce13 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 11 Feb 2025 00:18:11 +0100 Subject: rushed implementation of VRM thirdPersonOnly --- world/src/mesh.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'world/src/mesh.rs') diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 6fff9c4..ebecfa5 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -14,7 +14,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -use crate::{Args, TextureCache, load_texture}; +use crate::{Args, TextureCache, load_texture, vrm::VrmInfo}; use anyhow::Result; use gltf::{Mesh, Node, buffer::Data}; use log::{debug, info, warn}; @@ -37,6 +37,7 @@ pub fn import_mesh( args: &Args, texture_cache: &TextureCache, joint_index_map: &BTreeMap<(usize, u16), u32>, + vrm: &VrmInfo, ) -> Result<()> { for p in mesh.primitives() { let name = mesh.name().or(node.name()).map(|e| e.to_owned()); @@ -348,6 +349,12 @@ pub fn import_mesh( None }; + let hint_hide_first_person = if vrm.hide_first_person.contains(&node.index()) { + Some(()) + } else { + None + }; + let armature = node.skin().map(|_| 0); let mesh = store.set(&MeshPart { @@ -383,6 +390,7 @@ pub fn import_mesh( tex_transmission, tex_thickness, tex_occlusion, + hint_hide_first_person, // not supported by gltf hint_mirror: None, // TODO hint_static: None, // TODO Set when instancing -- cgit v1.2.3-70-g09d2