mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
no flags for mdl v3, but yes to skin type
This commit is contained in:
parent
f604a84363
commit
dc74519205
1 changed files with 12 additions and 15 deletions
|
@ -3,23 +3,20 @@ from pprint import *
|
|||
import sys
|
||||
|
||||
model = open(sys.argv[1],"rb").read()
|
||||
m = unpack ("4s l 3f 3f f 3f i i i i i i i i", model[:80])
|
||||
model = model[80:]
|
||||
m = unpack ("4s l 3f 3f f 3f i i i i i i i", model[:76])
|
||||
model = model[76:]
|
||||
m = m[0:2] + (m[2:5],) + (m[5:8],) + m[8:9] + (m[9:12],) + m[12:20]
|
||||
if m[2] == 6:
|
||||
m = m + unpack ("f", model[:4])
|
||||
model = model[4:]
|
||||
m = m + unpack ("i f", model[:8])
|
||||
model = model[8:]
|
||||
pprint (m)
|
||||
|
||||
skins = []
|
||||
s = m[7] * m[8]
|
||||
for i in range(m[6]):
|
||||
if m[2] == 6:
|
||||
t = unpack ("l", model[:4])[0]
|
||||
model = model[4:]
|
||||
else:
|
||||
t = 0
|
||||
if t==0:
|
||||
t = unpack ("l", model[:4])[0]
|
||||
model = model[4:]
|
||||
if t == 0:
|
||||
skins.append((t,model[:s]))
|
||||
model = model[s:]
|
||||
else:
|
||||
|
@ -31,7 +28,8 @@ for i in range(m[6]):
|
|||
k[2].append (model[:s])
|
||||
model = model[s:]
|
||||
skins.append (k)
|
||||
model = model[8:]
|
||||
if m[2] == 3:
|
||||
model = model[0:]
|
||||
#pprint (skins)
|
||||
|
||||
stverts = []
|
||||
|
@ -39,14 +37,14 @@ for i in range(m[9]):
|
|||
x = unpack ("l l l", model[:12])
|
||||
stverts.append ((x[0], x[1:]))
|
||||
model = model [12:]
|
||||
pprint (stverts)
|
||||
#pprint (stverts)
|
||||
|
||||
tris = []
|
||||
for i in range(m[10]):
|
||||
tris.append (unpack ("l l l l", model[:16]))
|
||||
tris[-1] = (tris[-1][0], tris[-1][1:])
|
||||
model = model [16:]
|
||||
pprint (tris)
|
||||
#pprint (tris)
|
||||
|
||||
frames = []
|
||||
for i in range (m[11]):
|
||||
|
@ -66,7 +64,6 @@ for i in range (m[11]):
|
|||
x = unpack("3B B", model[:4])
|
||||
model = model[4:]
|
||||
f[2].append((x[:3], x[3]))
|
||||
pprint (x)
|
||||
frames.append(f)
|
||||
else:
|
||||
g = (t, unpack ("l 3B B 3B B", model[:12]))
|
||||
|
@ -83,6 +80,6 @@ for i in range (m[11]):
|
|||
model = model[4:]
|
||||
g[3].append(f)
|
||||
frames.append(g)
|
||||
pprint(frames)
|
||||
#pprint(frames)
|
||||
pprint (model)
|
||||
print len(model)
|
||||
|
|
Loading…
Reference in a new issue