From: Mikko Rasa Date: Thu, 11 Oct 2007 15:10:17 +0000 (+0000) Subject: Blender exporter: Generate correct normals for smooth vertices X-Git-Tag: 0.9~35 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=926d77eb54f915a6620eb879a91c1c4bd0f06bbc;p=libs%2Fgl.git Blender exporter: Generate correct normals for smooth vertices --- diff --git a/mesh_export.py b/mesh_export.py index d7531b36..0158bdbf 100644 --- a/mesh_export.py +++ b/mesh_export.py @@ -83,13 +83,16 @@ class SmoothGroup: v=f.verts[i] if v.index not in vert_map: vt=Vertex(v) - if not f.smooth: - vt.no=f.no + vt.no=Blender.Mathutils.Vector(f.no) self.verts.append(vt) vert_map[v.index]=vt f.verts[i]=vt else: f.verts[i]=vert_map[v.index] + vert_map[v.index].no+=f.no + + for v in self.verts: + v.no.normalize() class Exporter: