From 11f37298bea0bf53a8da83c07446e83f5454dc0a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 15 Sep 2011 17:23:40 +0900 Subject: [PATCH] Reveres the face windings. Blender's vertex order and quake's vertex order seem to be opposed. --- tools/qfmdl/import_mdl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/qfmdl/import_mdl.py b/tools/qfmdl/import_mdl.py index 30a882b96..ec9d5f80b 100644 --- a/tools/qfmdl/import_mdl.py +++ b/tools/qfmdl/import_mdl.py @@ -175,7 +175,9 @@ def make_faces(mdl): faces = [] uvs = [] for tri in mdl.tris: - faces.append (tri.verts) + tv = tri.verts + tv = tv[2], tv[1], tv[0] # flip the normal by reversing the winding + faces.append (tv) sts = [] for v in tri.verts: stv = mdl.stverts[v] @@ -186,6 +188,7 @@ def make_faces(mdl): # quake textures are top to bottom, but blender images # are bottom to top sts.append((s * 1.0 / mdl.skinwidth, 1 - t * 1.0 / mdl.skinheight)) + sts = sts[2], sts[1], sts[0] # to match face vert reversal uvs.append(sts) return faces, uvs