mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-25 05:47:45 +00:00
Fix model submesh bone map size for Shadowbringers
Not entirely sure if this is correct yet, I need to test this more.
This commit is contained in:
parent
b1d0ccc90e
commit
99f79ddb6b
1 changed files with 12 additions and 6 deletions
16
src/model.rs
16
src/model.rs
|
@ -321,7 +321,7 @@ struct ModelData {
|
||||||
bone_tables: Vec<BoneTable>,
|
bone_tables: Vec<BoneTable>,
|
||||||
|
|
||||||
#[br(count = header.bone_table_count)]
|
#[br(count = header.bone_table_count)]
|
||||||
#[br(if(file_header.version >= 0x1000005))]
|
#[br(if(file_header.version >= 0x1000006))]
|
||||||
bone_tables_v2: Vec<BoneTableV2>,
|
bone_tables_v2: Vec<BoneTableV2>,
|
||||||
|
|
||||||
#[br(count = header.shape_count)]
|
#[br(count = header.shape_count)]
|
||||||
|
@ -333,15 +333,23 @@ struct ModelData {
|
||||||
#[br(count = header.shape_value_count)]
|
#[br(count = header.shape_value_count)]
|
||||||
shape_values: Vec<ShapeValue>,
|
shape_values: Vec<ShapeValue>,
|
||||||
|
|
||||||
submesh_bone_map_size: u16,
|
// TODO: try to unify these fields?
|
||||||
|
#[br(if(file_header.version <= 0x1000005))]
|
||||||
|
submesh_bone_map_size: u32,
|
||||||
|
|
||||||
#[br(count = submesh_bone_map_size / 2)]
|
// hehe, Dawntrail made this u16 instead of u32. fun?
|
||||||
|
#[br(if(file_header.version >= 0x1000006))]
|
||||||
|
submesh_bone_map_size_v2: u16,
|
||||||
|
|
||||||
|
#[br(count = if file_header.version >= 0x1000006 { (submesh_bone_map_size_v2 / 2) as u32 } else { submesh_bone_map_size / 2 } )]
|
||||||
submesh_bone_map: Vec<u16>,
|
submesh_bone_map: Vec<u16>,
|
||||||
|
|
||||||
padding_amount: u8,
|
padding_amount: u8,
|
||||||
#[br(count = padding_amount)]
|
#[br(count = padding_amount)]
|
||||||
unknown_padding: Vec<u8>,
|
unknown_padding: Vec<u8>,
|
||||||
|
|
||||||
|
#[br(dbg)]
|
||||||
|
// TODO: these are still wrong on Dawntrail!
|
||||||
bounding_box: BoundingBox,
|
bounding_box: BoundingBox,
|
||||||
model_bounding_box: BoundingBox,
|
model_bounding_box: BoundingBox,
|
||||||
water_bounding_box: BoundingBox,
|
water_bounding_box: BoundingBox,
|
||||||
|
@ -445,8 +453,6 @@ impl MDL {
|
||||||
|
|
||||||
let model = ModelData::read_args(&mut cursor, binrw::args! { file_header: &model_file_header }).ok()?;
|
let model = ModelData::read_args(&mut cursor, binrw::args! { file_header: &model_file_header }).ok()?;
|
||||||
|
|
||||||
//println!("{:#?}", model);
|
|
||||||
|
|
||||||
let mut affected_bone_names = vec![];
|
let mut affected_bone_names = vec![];
|
||||||
|
|
||||||
for offset in &model.bone_name_offsets {
|
for offset in &model.bone_name_offsets {
|
||||||
|
|
Loading…
Add table
Reference in a new issue