Recently I dusted off my old script for SC3 and realized alot more work was required for me to import models correctly
So I spent a week documenting as much as possible of the mesh binary so that I might have a better chance identifying the mesh info.
I created this flow charted to outline an overview of the blocks and there order presented throughout the model binary.
*The Arrows indicate a offset within a block that jumps to another block

Here is my structure for the header block;
Code: Select all
struct HEADER {
uint32 filetype;
uint8 unk001;
uint8 unk002;
uint8 unk003;
uint8 unk004;
uint16 table1_count;
uint16 bone_count;
uint32 unk005;
uint32 unk006;
uint32 unk007;
uint32 unk008;
uint32 unk009;
uint32 bone_addr;
uint32 tex_file_addr;
uint32 table1a_addr;
uint32 table5_addr;
uint32 table4_addr;
uint32 table7_addr;
uint32 unk016;
uint32 table1_addr;
uint32 table2_addr;
uint32 table3_addr;
uint32 table6_addr;
}
Skinned data requiring local bone indices of course which are important for deforming the mesh back to world space.
Theres a lot of ridiculous jumping from table1 to to geometry block, alot of the table subs, table1a - table1d mostly just contain a single offset to the next table.... anyways my maxscript is VERY messy lol
But here is the current script (it needs fixing)
I'm having 2 problems at the moment that I've been unable to resolve;
1.) direction of the mesh faces cause the mesh to have flipped cases all over
2.) for some reason the lips are distorted


*(manually corrected flipped faces to emphasize the lip issue)
I can live with the flipped face issue, but the face being distorted is a real problem, and looking at zaramot and fatducks screenshots I'm thinking my method of transforming the mesh to world space is flawed.
If anyones still interested in this game, please have a look at the script and give your thoughts
line #1205 in my maxscript shows how I'm transforming the vertices to world space, it works for everything except the lips on the face
Code: Select all
tfm = matrix3 1
tfm.row4 = vert2 / wt
tfm*=boneArray[table1a[mesh_object].indices[(bit.shift bi -2) + 1] + 1].transform
vert+= tfm.row4 * wt