mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-22 12:47:45 +00:00
Fix Dawntrail model loading
I figured out some crappy padding I need to add, not sure what these exactly are yet!
This commit is contained in:
parent
2af1543c9b
commit
dff1a83809
1 changed files with 12 additions and 2 deletions
14
src/model.rs
14
src/model.rs
|
@ -312,8 +312,11 @@ struct ModelData {
|
|||
#[br(count = header.shape_value_count)]
|
||||
shape_values: Vec<ShapeValue>,
|
||||
|
||||
// TODO: Dawntrail doesn't seem to have these anymore? Needs more testing
|
||||
#[br(if(file_header.version < 0x01000006, 0))]
|
||||
// TODO: Dawntrail mysteries
|
||||
#[br(if(file_header.version >= 0x01000006))]
|
||||
#[br(count = 24)]
|
||||
_padding1: Vec<u8>,
|
||||
|
||||
submesh_bone_map_size: u32,
|
||||
|
||||
#[br(count = submesh_bone_map_size / 2)]
|
||||
|
@ -323,6 +326,11 @@ struct ModelData {
|
|||
#[br(count = padding_amount)]
|
||||
unknown_padding: Vec<u8>,
|
||||
|
||||
// TODO: Dawntrail mysteries
|
||||
#[br(if(file_header.version >= 0x01000006))]
|
||||
#[br(count = 385)]
|
||||
_padding2: Vec<u8>,
|
||||
|
||||
bounding_box: BoundingBox,
|
||||
model_bounding_box: BoundingBox,
|
||||
water_bounding_box: BoundingBox,
|
||||
|
@ -426,6 +434,8 @@ impl MDL {
|
|||
|
||||
let model = ModelData::read_args(&mut cursor, binrw::args! { file_header: &model_file_header }).ok()?;
|
||||
|
||||
//println!("{:#?}", model);
|
||||
|
||||
let mut affected_bone_names = vec![];
|
||||
|
||||
for offset in &model.bone_name_offsets {
|
||||
|
|
Loading…
Add table
Reference in a new issue