c4e409c04a
Fix some warnings
2024-06-28 06:10:37 -04:00
91560de96b
Fix shape values not reading correctly
2024-05-25 23:26:11 -04:00
e5caab2e64
Run rustfmt and fix more Clippy warnings
2024-05-18 09:42:07 -04:00
1823b1f084
Fix the shapes crashing on certain models
...
This is a hack to get things working for now
2024-04-27 18:43:32 -04:00
58c3e15e2c
Remove some more debug messages
2024-04-20 15:12:40 -04:00
d5b3b8a468
Run cargo fmt
2024-04-20 13:18:03 -04:00
6e50f03cd9
Fix yet more clippy warnings
2024-04-20 13:17:11 -04:00
99f79ddb6b
Fix model submesh bone map size for Shadowbringers
...
Not entirely sure if this is correct yet, I need to test this more.
2024-04-17 21:59:23 -04:00
774740c470
Remove temporary padding "fixes" for Dawntrail models
...
According to https://github.com/TexTools/xivModdingFramework/pull/60 the
bone table structure changed. Now the correct bone table is loaded for
Dawntrail.
2024-04-17 21:26:50 -04:00
2e27a999d6
Add types for short2/short4 vertex formats
...
As seen in 16d32cf5a8
2024-04-17 20:44:12 -04:00
b86eb29d81
Temporarily fix loading blend weights from Dawntrail
2024-04-17 20:22:50 -04:00
dff1a83809
Fix Dawntrail model loading
...
I figured out some crappy padding I need to add, not sure what these
exactly are yet!
2024-04-17 17:47:03 -04:00
a7a9a7855e
Add invalid data test for MDL
2024-04-16 22:05:39 -04:00
26e89e8873
Remove more dead code
2024-04-16 21:19:08 -04:00
f067b653b1
Add common functions for converting bool back and forth from u8/16
...
Sort of unnecessary, but these are also tested.
2024-04-16 21:03:26 -04:00
281fb68fca
Take into account the submesh bone map when calculating runtime again
...
This was an accidental commit while testing.
2024-04-14 13:36:27 -04:00
9e7fc833ef
Don't parse submesh bonemaps in Dawntrail models
...
Not sure if these are completely gone yet, but this is needed to at
least partially load Dawntrail models.
2024-04-14 13:26:51 -04:00
7c3d5a3142
Add new unknown vertex type found in Dawntrail benchmark
...
Not sure what it's used for yet, but needed to be added so parsing
doesn't completely fail.
2024-04-14 13:25:50 -04:00
733a079f9a
Add preliminary support for writing shape keys into MDL files
...
This is not complete as it only deals with the header data and doesn't
append the morphed vertices properly yet.
2024-03-05 17:08:07 -05:00
6bf60b0cfd
Add support for reading shape morphs from MDL
2024-03-02 17:23:55 -05:00
840fb21ba0
Test the replace_vertices function
2024-03-01 15:47:58 -05:00
d75296f4d2
Make the data offset calculations a little bit clearer
2024-03-01 15:47:47 -05:00
ebca076c2d
Begin testing some of the model parsing functions
2024-02-25 10:30:50 -05:00
ed5a9b52b1
Separate the model header updating, and add test
...
This adds the model file for c0201e0038_top but everything but the
header parts are zeroed out to prevent possible copyright infringement.
2024-02-25 10:26:05 -05:00
3389f62340
Implement shape reading/writing, fix runtime size calculation
2024-02-25 09:35:18 -05:00
36027c9a9f
Write out a proper end of stream vertex element
2024-02-25 09:01:59 -05:00
f43812fa55
Fix up padding/unknowns in ModelHeader
2024-02-25 08:54:27 -05:00
4194ec4432
Rename Uint4 to Byte4 so it's clearer
2024-02-25 08:54:16 -05:00
ecc872ead1
Use better constant values for model file header and vertex element
2024-02-25 08:41:03 -05:00
872cabb2fa
Support terrain shadow meshes and submesh meshes
...
This should fix most terrain models which has this data filled.
2024-02-02 14:19:36 -05:00
e26c70221e
Oops, half4 positions should not be written as single4
2024-01-29 17:18:13 -05:00
5629cc5551
When writing half4 normals, fill it with 0.0 instead of 1.0
2024-01-29 17:06:24 -05:00
afe809f33c
Store the unknown padding
...
Don't know what it's used for yet still.
2024-01-29 17:05:57 -05:00
c7c9c38980
Move comment to it's right place in ModelData::calculate_runtime_size
2024-01-29 16:02:56 -05:00
1810821fd7
Implement Default trait for Vertex
2024-01-29 16:01:58 -05:00
eb08d9f142
Move calculating runtime size to it's own function
2024-01-29 15:57:00 -05:00
6000720658
Fix tangent reading/writing
2023-12-17 18:58:48 -05:00
3721644340
Separate vertex declaration/element code into its own file
...
This is around 100 LoC by itself, so it's nice to separate that
2023-12-13 17:23:56 -05:00
0b0850c574
Use custom binrw parsers/writers for VertexDeclarations
...
Eventually I want to consolidate the model headers, and this makes it,
so we only need a ModelFileHeader::read or write call without a separate
step.
2023-12-13 17:19:06 -05:00
835b48ff5b
Add explicit calculate_stack_size function and test it
2023-12-13 16:51:40 -05:00
fadf811505
Move the model file operations to their own file
...
It helps declutter the already huge model file a bit.
2023-12-12 22:13:15 -05:00
60f4d49a0c
Remove more magic constant numbers with std::mem::size_of
2023-12-12 22:08:19 -05:00
5cce23bd3c
Finish model writing support
...
It now handles writing a model of a higher vertex count (which is
unfortunately really common in round trips, for example in Blender.)
Some of the code is still WIP, but it works!
2023-12-12 21:43:04 -05:00
5f1721fe14
Begin work on supporting writing different vertex counts
2023-12-10 14:52:49 -05:00
fc2d2f73cf
Begin support for importing models of different vertex/index counts
2023-12-09 17:18:02 -05:00
c2426193ca
Add MDL::replace_vertices function
...
Will be used for model writing in the future
2023-12-09 14:45:00 -05:00
e23383f439
Remove for loop in writing MDL indices
2023-11-24 08:29:32 -05:00
7b162f6644
Replace some magic numbers with more readable constants
2023-11-24 08:25:45 -05:00
49a8752462
Remove unused round function in MDL
2023-11-24 08:18:46 -05:00
108d33f166
Add MDL::pad_slice test
2023-11-24 08:18:15 -05:00