diff --git a/tools/misc/mdl.py b/tools/misc/mdl.py index 39b311781..a934948bc 100644 --- a/tools/misc/mdl.py +++ b/tools/misc/mdl.py @@ -28,38 +28,34 @@ for i in range(m[6]): k[2].append (model[:s]) model = model[s:] skins.append (k) -if m[2] == 3: - model = model[0:] -#pprint (skins) +pprint (skins) stverts = [] 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]): - if m[2] == 6: - t = unpack ("l", model[:4])[0] - model = model[4:] - else: - t = 0 + t = unpack ("l", model[:4])[0] + model = model[4:] if t==0: if m[2] == 6: f = (t, unpack ("3B B 3B B 16s", model[:24]), []) model = model[24:] else: - f = (t, unpack ("3B B 3B B f", model[:12]), []) - model = model[12:] + x = unpack ("3B B 3B B", model[:8]) + f = (t, x, []) + model = model[8:] for j in range(m[9]): x = unpack("3B B", model[:4]) model = model[4:] @@ -80,6 +76,4 @@ for i in range (m[11]): model = model[4:] g[3].append(f) frames.append(g) -#pprint(frames) -pprint (model) -print len(model) +pprint(frames)