From ae9e813eaf5b04c8dddc9da1a1f5d50da1f5bddb Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 11 Feb 2025 23:43:58 +0100 Subject: set first person hint based on head bones in joint_index --- world/src/vrm.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'world/src/vrm.rs') diff --git a/world/src/vrm.rs b/world/src/vrm.rs index 1b89642..2888ad0 100644 --- a/world/src/vrm.rs +++ b/world/src/vrm.rs @@ -17,10 +17,7 @@ use anyhow::Result; use gltf::Gltf; use serde::Deserialize; -use std::{ - collections::{BTreeMap, BTreeSet}, - fs::File, -}; +use std::collections::{BTreeMap, BTreeSet}; pub struct VrmInfo { pub bone_node_names: Vec<(usize, String)>, @@ -31,14 +28,14 @@ pub fn extract_vrm_data(gltf: &Gltf) -> Result { let mut bone_node_names = Vec::new(); let mut hide_first_person = BTreeSet::new(); if let Some(vrm) = gltf.extension_value("VRM") { - serde_json::to_writer(File::create("/tmp/vrm").unwrap(), vrm).unwrap(); + // serde_json::to_writer(std::fs::File::create("/tmp/vrm").unwrap(), vrm).unwrap(); let vrm: Vrm = serde_json::from_value(vrm.clone())?; for bone in vrm.humanoid.human_bones { bone_node_names.push((bone.node, bone.bone)) } } if let Some(vrm) = gltf.extension_value("VRMC_vrm") { - serde_json::to_writer(File::create("/tmp/vrmc").unwrap(), vrm).unwrap(); + // serde_json::to_writer(std::fs::File::create("/tmp/vrmc").unwrap(), vrm).unwrap(); let vrm: Vrmc = serde_json::from_value(vrm.clone())?; for (name, bone) in vrm.humanoid.human_bones { bone_node_names.push((bone.node, name)) @@ -54,7 +51,6 @@ pub fn extract_vrm_data(gltf: &Gltf) -> Result { } } } - eprintln!("hide {hide_first_person:?}"); Ok(VrmInfo { bone_node_names, hide_first_person, -- cgit v1.2.3-70-g09d2