Satoh wrote:That's good to know, thanks. When I look back into this, hopefully I'll be able to bash something out.
I honestly hadn't expected any interest to arise, but I'm glad to see someone's done something.
Thanks for posting your info.
Okay here is the rough format of md model archives
They begin with the text string
scr (which is 73 63 72 in hex)
followed by:
00 00 00 00 00
and then the 4byte number of how many submeshes #SUBMESH are in the file starting at 1 for 1 submesh
followed by:
00 00 00 00
Followed by the same amount of offsets of the value of #SUBMESH
Then all of the rest of the bytes on that line are padded to be 00 until the next line that ends in a offset in 00 eg (010a08-010a10)
Then the first submesh begins with the text string mdb (which is 6D 64 62 in hex)
followed by a 4byte integer specifying what the type of mesh #MESHTYPE (maybe 30 is animated and 20 is static)
followed by a 2byte integer maybe an id #MESHID?
followed by a 2byte integer which is the number of mesh divisions, #MESHDIVISIONS
followed by 16 bytes of zero: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
followed by the relative pointers to each mesh division, #DIVISION1, #DIVISION2... calculated from the text string mdb
Followed by padding until the next 16byte line row.
Followed by some type of boneweights? BoneX,BoneY,BoneZ,Boneid
Bones continue until the beginning of the the first Division
Here there are pointers to the various componets, they are relative to the where the first pointer is
@Vertexes, ???, @ImplicitTextureMapping, @TexturecolorWeight, @TextureUV
Followed by 2byte number of vertexes #Vertexes
Followed by zero padding until the next 16byte row
VERTEXES:
Are 4byte floating point numbers with an additional 4byte connection information to cull faces that should not be connected to each other. Faces are tristripes except when Connection is 00 80 00 00 for two vertexes in a row.
The rest of each Divison is texture information stored in 3 sections each with 4bytes per vertex therefore eliminating the need of pointers to each section:
TextureMapping, TexturecolorWeight, TextureUV.
TexturecolorWeight is usually just 80 80 80 80.