1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-23 21:17:45 +00:00
Commit graph

48 commits

Author SHA1 Message Date
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
cf79810dc9 Fix rounding errors
Now model files can be read and written and are (almost) identical!
There's some mysterious padding issues yet to solve, but that's only at
the end of the file.
2023-11-24 08:16:03 -05:00
5f7dd355cf Add support for UV1 reading/writing, tangent and color 2023-11-24 08:07:30 -05:00
18bb4ac54c Add fill argument for MDL::pad_slice 2023-11-24 08:07:10 -05:00
280ba9b292 Add tests for MDL component reading and writing 2023-11-24 08:06:57 -05:00
b99599867a Fix up more model writing woes 2023-11-22 21:21:01 -05:00
7a75c170cc Make a semantic difference between owned and non-owned byte data 2023-10-13 16:16:04 -04:00
4dfd36dbd8 Fix and quiet clippy warnings 2023-09-22 19:17:24 -04:00
bbbbb7cd02 Add the last missing pieces for model writing
This isn't a complete 1-to-1 yet, and still untested. However the
general idea is there now.
2023-09-22 17:42:04 -04:00
3a50523dd5 Add support for writing the rest of the model header and metadata 2023-09-22 17:04:48 -04:00
3d621d3588 Begin work on implementing MDL write support 2023-09-22 16:44:19 -04:00
2000b978b3 Ensure compliance with REUSE, add to CI 2023-08-06 08:25:04 -04:00
b3f8523677 Add support for single3/4 normals and UVs
Seems to be common in TexTools imported MDLs
2023-07-09 11:56:45 -04:00
ef97cfd1ce Simplify vertex loading and fix incorrect bone data 2023-07-05 19:42:53 -04:00
ba80ca326b Export material indices for MDL parts 2023-03-31 21:31:15 -04:00
8af6bfeb8b Export material names used in MDL files 2023-03-31 21:31:03 -04:00
67d2f035c3 Reformat code with rustfmt 2022-10-20 11:45:55 -04:00
a9fa6d714a Use read_le instead of manually passing ReadOptions 2022-10-17 19:24:02 -04:00
eebe89a4bd Remove some import warnings 2022-10-13 17:11:28 -04:00
177523831b Switch a lot more parsers from binread -> binrw
This doesn't necessarily mean that these formats support writing (yet)
but just to solve the initial compilation errors.
2022-10-13 17:11:03 -04:00
c3c3df7c68 More small warning changes 2022-10-13 16:11:20 -04:00
e86d910594 Update binrw to 0.10.0
This introduces a new breaking change, namely that all endianness must
be known. I've done the best I can, but I'll be checking soon.
2022-10-13 16:03:46 -04:00
9819f87fcc Suppress some warnings 2022-09-15 16:26:31 -04:00
d9e79e563a Reformat code 2022-08-16 11:52:07 -04:00
5ca60cb95d Export affected bone names 2022-08-10 14:51:50 -04:00
8b6b6b036c More small changes to the model module
* Removed unused import
* Used more result checks
* Removed unnecessary mutable variable
2022-08-06 18:07:42 -04:00
287d807f01 Normals are typically three half-width floats, not three full floats 2022-08-05 18:23:52 -04:00
195726b1d0 Make vertex members public, and repr(C) 2022-07-28 15:20:47 -04:00
ddda9bc598 Remove other debug message when loading a mdl 2022-07-28 14:17:50 -04:00
aeed62fb4c Implement MDL parsing
The actual vertex output is untested, but the headers parse fine it
seems. A lot of this is ported straight from C++, so more refactoring
is expected.
2022-07-28 14:11:02 -04:00
389c3fe00b Add initial files 2022-07-19 19:29:41 -04:00