-
Notifications
You must be signed in to change notification settings - Fork 4
/
fmt_ask.py
43 lines (34 loc) · 1.01 KB
/
fmt_ask.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#by Durik256
from inc_noesis import *
def registerNoesisTypes():
handle = noesis.register("PES19/21", ".ask")
noesis.setHandlerTypeCheck(handle, noepyCheckType)
noesis.setHandlerLoadModel(handle, noepyLoadSkel)
return 1
def noepyCheckType(data):
return 1
def noepyLoadSkel(data, mdlList):
bs = NoeBitStream(data)
bs.seek(4)#1
bnum = bs.readUInt()
bones = []
for x in range(bnum):
bs.seek(4,1)
nofs = bs.readUInt()
parent = bs.readInt()
cpos = bs.tell()
bs.seek(cpos + nofs - 8)
name = bs.readString()
bs.seek(cpos)
pos = NoeVec3.fromBytes(bs.read(12))
#rot = NoeQuat.fromBytes(bs.read(16))
bs.seek(20,1)
mat = NoeMat43()
mat[3] = pos
bones.append(NoeBone(x,name,mat,None,parent))
if bones:
bones = rapi.multiplyBones(bones)
mdl = NoeModel()
mdl.setBones(bones)
mdlList.append(mdl)
return 1