In some models, the third byte (from the start of the file) is not 0. When it isn't then the first bone name does not follow the format that Chrrox/finale posted. If it has 1 then I have to skip the first bone Name and go to the second one, and if its 2 I have to skip the first two bone names and go to the third one. This allows me to read the models.chrrox wrote:here is the layout of the bsc files.
meshCount - byte
unkCount - byte
Null -byte
then you read 12 bytes of data * the unkCount +1
so if the number is 1 you read 24 bytes if it is 2 you read 36 bytes
Then you end up at your mesh pieces
for each mesh piece you read
boneName - string
then skip from the start of the bone name 0x42 bytes
then read 2 longs
vertCount - Long
faceCount - long
then you read the mesh data
vert Structure 0x2C
00 - 0C Vertex positions as floats
0C - 18 normals as floats
18 - 1C Vertex Color as bytes
1C - 24 UV's as floats
24 - 2C Null and not used
then read the faces as normal triangle lists. unsigned shorts
that is it just repeat this for the mesh count and your done.
there should be a global skeleton file somewhere that the mesh pieces attach to.
However, when the third byte is greater than 0 what does the data prior to the actual mesh data contain? Since if I were to write an exporter for this, I would need to know what each data is what. Funny thing is, when I set the third byte to 0 and removed the extra data (via hex editor) that appear before the actual mesh data, and the model loaded fine in game just how it loaded originally. I did not notice any difference between the original and the modified one.
Also, I've noticed the "unkCount" thing that Chrrox posted doesn't really validate on all models.
In fact, the second byte (the one you referred to as unkCount) is actually the number of textures it should load.
1 = .ba0
2 = .bb0 (including .ba0 will be loaded)
3 = .bc0 (.bb0, and .ba0 will be loaded)
4 = .bd0
and so forth
I could manage to figure out how the offset of the first boneName is located, so I am manually scanning for whether the name begins with Bo or bo and then break and -2 the seek to obtain the Bone name. It's quite reliable and works on all models I've tested on so far. I'm quite sure it's possible to calculate the first position, and rather would prefer this method. But I cannot seem to figure out how this is done.
I'm unsure on how to attach the current models to the skeleton file so I'll attach the models and the skeleton.
Here is the model files: http://www.mediafire.com/?dpuup6j651g3d63
And here's the skeleton: http://www.mediafire.com/?dy9vyydbxq754sj
gr_010_arm/body are the files that does not have 0 in the third byte of the file [unsure of what the third byte does?].
gr_030_arm loads but does not appear correct. (needs to be mapped to the skeleton, have no clue on how to do)
It looks like this using the data provided by Chrrox/Finale:
When really it should look like this (ignore the shoulder part and shield):
I have also noted when a model is loaded the angel of the model is in a different angel, I am unable to get it to load in a correct angel like how finale000 did. Mind sharing how that was done?
Here's how it looks for me: