summaryrefslogtreecommitdiff
path: root/world/src/vrm.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-02-11 23:43:58 +0100
committermetamuffin <metamuffin@disroot.org>2025-02-11 23:43:58 +0100
commitae9e813eaf5b04c8dddc9da1a1f5d50da1f5bddb (patch)
treeb49dc88fa527bf12c6efe9a3aa3eb7d8923b43ee /world/src/vrm.rs
parent174f668c437a83bdb7787a828b0c4fb7f2521aa1 (diff)
downloadweareserver-ae9e813eaf5b04c8dddc9da1a1f5d50da1f5bddb.tar
weareserver-ae9e813eaf5b04c8dddc9da1a1f5d50da1f5bddb.tar.bz2
weareserver-ae9e813eaf5b04c8dddc9da1a1f5d50da1f5bddb.tar.zst
set first person hint based on head bones in joint_index
Diffstat (limited to 'world/src/vrm.rs')
-rw-r--r--world/src/vrm.rs10
1 files changed, 3 insertions, 7 deletions
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<VrmInfo> {
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<VrmInfo> {
}
}
}
- eprintln!("hide {hide_first_person:?}");
Ok(VrmInfo {
bone_node_names,
hide_first_person,