Textures stored in tex files. A single tex file may contain multiple textures. Materials index into the texture file.
The tex filename is the same as the model filename.
It is a typical chunk based format.
You have the tag, followed by chunk size, followed by two integers, followed by the rest of the data.
So for example if you have the VTX0 vertex chunk, it'll be followed by the chunk size, the numVerts, and a 0, followed by the vertex buffer.
Unfortunately, some of the chunks have extra padding at the end which is not included in the chunk size.
I have not figured out how this works, so I can't write a general parser and have to parse each chunk manually, then run some silly function to skip the potential padding. Would be nice if there was a way to determine whether there's padding ahead of time so I can ignore all this manual parsing and just parse it like a proper chunk-based format.
Script permalink: http://db.tt/4nOiIdl4
Client DL: available on wiki
bms unpacker:
Code: Select all
get FILES long
get UNK long
for i = 0 < FILES
get NSIZE short
getdstring NAME NSIZE
get OFFSET long
get SIZE long
log NAME OFFSET SIZE
next i