Code: Select all
def section_1861(g):
num = g.i(1)[0]
for m in range(num):
name=g.find('\x00')
bone_name_list.append(name)
Code: Select all
def section_1861(g):
num = g.i(1)[0]
for m in range(num):
name=g.find('\x00')
bone_name_list.append(name)
Code: Select all
def section_656(g):
g.B(4)
num = g.i(4)
for m in range(num[3]):
t=g.tell()
v=g.i(3)
g.seek(t+152,0)
bone_parent_list.append(v[1])
Code: Select all
def section_1(g):
num = g.i(2)
for m in range(num[1]):
Code: Select all
def section_1(g):
num = g.i(2)
for m in range(num[1]):
rotmatrix=Matrix(g.f(3),g.f(3),g.f(3)).resize4x4()
posmatrix=TranslationMatrix(Vector(g.f(3)))
bone_matrices_list.append([rotmatrix,posmatrix])
def cgfParser(filename,g):
global mesh,skeleton
global bone_matrices_list
global bone_parent_list
global bone_name_list

Code: Select all
def section_656(g):
g.B(4)
num = g.i(4)
for m in range(num[3]):
t=g.tell()
v=g.i(3)
g.seek(t+152,0)
bone_parent_list.append(v[1])
def section_1861(g):
num = g.i(1)[0]
for m in range(num):
name=g.find('\x00')
bone_name_list.append(name)

for m in range(nSec):
off_list.append([g.B(4),g.i(3)])

Code: Select all
for m in range(nSec):
chunk=off_list[m][0]
type=off_list[m][1][0]
off=off_list[m][1][1]
g.seek(off,0)
Code: Select all
for m in range(nSec):
chunk=off_list[m][0]
type=off_list[m][1][0]
off=off_list[m][1][1]
g.seek(off,0)
if type==0:
section_0(g)
if chunk==(0,0,204,204) and type==1860:
section_1860(g)
if chunk==(3,0,204,204) and type==656:
section_656(g)
if chunk==(5,0,204,204) and type==1861:
section_1861(g)
if chunk==(18,0,204,204) and type==1:
section_1(g)
if chunk==(12,0,204,204) and type==1863:
section_1863(g)
if chunk==(13,0,204,204) and type==2089:
anim_section_2089(bone_id)
bone_id+=1
Code: Select all
for m in range(len(bone_name_list)):
bone=Bone()
bone.name=bone_name_list[m]
bone.parentID=bone_parent_list[m]
bone.rotMatrix=bone_matrices_list[m][0]
bone.posMatrix=bone_matrices_list[m][1]
skeleton.boneList.append(bone)
skeleton.draw()
mesh.boneNameList=skeleton.boneNameList
mesh.draw() 
Code: Select all
def section_2089(g):
num=g.i(2)
abone=ActionBone()
framecountlist.append(num[0])
for m in range(num[0]):
Code: Select all
t=g.tell()
time = int(g.i(1)[0]/160)
pos=g.f(3)
rot=g.f(4)
Code: Select all
def section_1860(g):
g.B(4)
num = g.i(8)
for m in range(num[4]):
t=g.tell()
mesh.vertPosList.append(g.f(3))
g.seek(t+24,0)
Code: Select all
for m in range(num[6]):
t=g.tell()
mesh.faceList.append(g.i(3))
matID,unk=g.i(2)
mesh.matIDList.append(matID)
g.seek(t+20,0)
if num[3]!=0: 