mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-22 04:37:46 +00:00
Export affected bone names
This commit is contained in:
parent
5d8e8e23e5
commit
5ca60cb95d
1 changed files with 19 additions and 2 deletions
21
src/model.rs
21
src/model.rs
|
@ -309,7 +309,8 @@ pub struct Lod {
|
|||
}
|
||||
|
||||
pub struct MDL {
|
||||
pub lods : Vec<Lod>
|
||||
pub lods : Vec<Lod>,
|
||||
pub affected_bone_names : Vec<String>
|
||||
}
|
||||
|
||||
impl MDL {
|
||||
|
@ -342,6 +343,21 @@ impl MDL {
|
|||
|
||||
let model = ModelData::read(&mut cursor).unwrap();
|
||||
|
||||
let mut affected_bone_names = vec![];
|
||||
|
||||
for mut offset in model.bone_name_offsets {
|
||||
let mut string = String::new();
|
||||
|
||||
let mut next_char = model.header.strings[offset as usize] as char;
|
||||
while next_char != '\0' {
|
||||
string.push(next_char);
|
||||
offset += 1;
|
||||
next_char = model.header.strings[offset as usize] as char;
|
||||
}
|
||||
|
||||
affected_bone_names.push(string);
|
||||
}
|
||||
|
||||
let mut lods = vec![];
|
||||
|
||||
for i in 0..model.header.lod_count {
|
||||
|
@ -415,7 +431,8 @@ impl MDL {
|
|||
}
|
||||
|
||||
Some(MDL {
|
||||
lods
|
||||
lods,
|
||||
affected_bone_names
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue