How it should be:
how it is:
The best I can make out of it:
Those 2 "unknowns" aren't unknown, they're 2 ints, first one stands for the first ChildBone, the second one for how many ChildBones it has.
According to those 2 ints I parented all the bones, I figured it out with the help of this "pic" i made.
Bone_index: Bone_name, child_index, numChildren
just to explain it a little: (for the example we start at index 27: bone_r_forearm)
children is not 0 so we jump to the child index (29)
29: bone_r_wrist children is not 0 (4) so we jump to the index (31) and the following 3 bones (indexes 31 -34)
they all have 0 children so the link stops there.
I checked all the bones in Noesis and they have their parents set correctly.
now for how far I got with loading them. I read the x/y/z position info seperately from the axis data and had to swap the y and Z data to get it to stand upright.
Code: Select all
boneBuff=self.inFile.readBytes(36)
x=self.inFile.readBytes(4)
y=self.inFile.readBytes(4)
z=self.inFile.readBytes(4)
boneMat.append(NoeMat43.fromBytes(boneBuff+x+z+y))
then I thought it seemed like the position info was relevant to the parent's position and not the actual position so i added them to gether starting from the second bone (bone_root) and that's where I'm stuck.
bonelinks = dictionary with each bone bone stating it's parent's index and name
bonenames = list with all the bonenames sorted according to their indexposition
Code: Select all
for i in range(1,numBones):
BoneData = boneMat[i]
BoneDataP= boneMat[bonelinks[bonenames[i]][0]]
for HKey in range(len(BoneData)):
for key in range(len(BoneData[HKey])):
boneMat[i][HKey][key] = boneMat[i][HKey][key] + BoneDataP[HKey][key]
in the .rar: 3 .msh files, a 010 editor template (hardcoded for the ancestralwarriorA.msh) and the .dae i exported (ancestralwarriorA.msh)
http://www.mediafire.com/?x0z8yhp5tfl21re