From 926d77eb54f915a6620eb879a91c1c4bd0f06bbc Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 11 Oct 2007 15:10:17 +0000 Subject: [PATCH] Blender exporter: Generate correct normals for smooth vertices --- mesh_export.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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: -- 2.45.2