Model Parsing help needed

Post questions about game models here, or help out others!
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 303 times

Re: Bots / Models (.Bsc - .obj)

Post by finale00 »

Didn't bother with the bone name

Outline is pretty much the same, except there's 24 bytes in the mesh struct after the vert and index counts.

Code: Select all

Struct Mesh {
   66 bytes
   int32 numVerts
   int32 numIdx
   24 bytes
   numVerts Vertex
   numIdx indices
}
Image
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: Bots / Models (.Bsc - .obj)

Post by Alsair »

finale00 wrote:Didn't bother with the bone name

Outline is pretty much the same, except there's 24 bytes in the mesh struct after the vert and index counts.

Code: Select all

Struct Mesh {
   66 bytes
   int32 numVerts
   int32 numIdx
   24 bytes
   numVerts Vertex
   numIdx indices
}
Image

ommmg how did you do you that

i will do any thing anything for you :D

just tell me how you did it

Free Kiss For You

nah Millions Kisses

i will download the program now and such of a noob

i don't won't to be pro nah i only want to get the modul of BSC Files
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: Bots / Models (.Bsc - .obj)

Post by Alsair »

here iam , , and i don't know what to do ^^

final00 you are the best . . every one is Creditz you in combat arms tuts for getting map moduls

you helped many people and i hope you help me in this too

sorry for being stupid :D

if you busy just give me a some topic links and i'll read it to learn any thing about using Neosis

Image
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: Bots / Models (.Bsc - .obj)

Post by Alsair »

can't any one help me
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: Bots / Models (.Bsc - .obj)

Post by Alsair »

what's the problem here ?
i do like the basic topbic
Image

Code: Select all

#Noesis Python model import+export test module, imports/exports some data from/to a 

made-up format

from inc_noesis import *

import noesis

#rapi methods should only be used during handler callbacks
import rapi

#registerNoesisTypes is called by Noesis to allow the script to register formats.
#Do not implement this function in script files unless you want them to be dedicated format 

modules!
def registerNoesisTypes():
   handle = noesis.register("Bots", ".bsc")
   noesis.setHandlerTypeCheck(handle, noepyCheckType)
   noesis.setHandlerLoadModel(handle, noepyLoadModel) #see also noepyLoadModelRPG
       #noesis.setHandlerWriteModel(handle, noepyWriteModel)
       #noesis.setHandlerWriteAnim(handle, noepyWriteAnim)
   noesis.logPopup()
       #print("The log can be useful for catching debug prints from preview loads.\nBut don't 

leave it on when you release your script, or it will probably annoy people.")
   return 1

NOEPY_HEADER = "GXXM0124"

#check if it's this type based on the data
def noepyCheckType(data):
   bs = NoeBitStream(data)
   if len(data) < 16:
      return 0
   if bs.readBytes(16).decode("ASCII").rstrip("\0") != NOEPY_HEADER:
      return 0
   return 1       

#load the model
def noepyLoadModel(data, mdlList):
   ctx = rapi.rpgCreateContext()
   bs = NoeBitStream(data)
   rapi.rpgClearBufferBinds()   
   return 1
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1397 times

Re: Bots / Models (.Bsc - .obj)

Post by chrrox »

you set the id string to 8 bytes then you read 16 bytes to check the header.
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: Bots / Models (.Bsc - .obj)

Post by Alsair »

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.
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:
Image
When really it should look like this (ignore the shoulder part and shield):
Image

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:
Image
Alsair
advanced
Posts: 66
Joined: Fri Jun 15, 2012 10:55 am
Has thanked: 4 times

Re: Bots / Models (.Bsc - .obj)

Post by Alsair »

Spent about 6 hours yesterday and 3 hours today looking up various examples on mapping bones, haven't found any that had been helpful so far.

Based on my research on the game:
1. The Bone names referenced in the bsc model files are references to the name defined in the xx_bone.bon file

The bone data is not located within the actual bsc files (All the examples I've seen has had the bone data stored inside the models and are parsing it from it directly, this game isn't like that).

I'm pretty sure I located the data for where the bones are located in the file in a hex editor by searching up the bone name. However, I am unable to calculate the offset for each bone name dynamically in the script. I have no idea how to parse the data I found in the hex editor and map it regardless of finding the correct offset.

Aside from that going based on this topic: viewtopic.php?f=29&t=3739
#6 shows how the matrixes are structured within that file
The floats are identically set up in the bone file (after locating the bone name) as seen in the following screenshot:
Image
However, the problem is I am unsure on how to handle this data, and how to locate the number of matrixes are here. In chrrox's topic it shows the number of floats stored but I could not find such value in my file.
I searched for the bone after that and calculated the number of floats by dividing the selected data by 0x40 and got 0xB55, but I don't see where this count is located anywhere.

Any help would be appreciated, this is pretty much where I'm stuck at right now for almost 3 days.

The bone files + some models have already been uploaded links to it are in the previous post.
Post Reply