From e0cb391c169b6ed0543bcec9b91b7a65f86b8fa8 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 5 Jun 2006 23:15:37 +0200 Subject: [PATCH] Fix handling Text and Curve objects Do not recalculate the normals for all object types, do this only for Text and Curve objects which can have the normals inverted when they are converted to mesh. REMOVE that when blender fixes the issue. Signed-off-by: Antonio Ospite --- vrm.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/vrm.py b/vrm.py index 312d8af..8914045 100755 --- a/vrm.py +++ b/vrm.py @@ -554,7 +554,6 @@ class Renderer: # Render from the currently active camera self.cameraObj = self._SCENE.getCurrentCamera() - print dir(self._SCENE) # Get the list of lighting sources obj_lst = self._SCENE.getChildren() @@ -754,14 +753,19 @@ class Renderer: scene.link(obj) scene.unlink(old_obj) - # Mesh Cleanup - me = obj.getData(mesh=1) - for f in me.faces: f.sel = 1; - for v in me.verts: v.sel = 1; - me.remDoubles(0) - me.triangleToQuad() - me.recalcNormals() - me.update() + + # XXX Workaround for Text and Curve which have some normals + # inverted when they are converted to Mesh, REMOVE that when + # blender will fix that!! + if old_obj.getType() in ['Curve', 'Text']: + me = obj.getData(mesh=1) + for f in me.faces: f.sel = 1; + for v in me.verts: v.sel = 1; + me.remDoubles(0) + me.triangleToQuad() + me.recalcNormals() + me.update() + def _doSceneClipping(self, scene): """Clip objects against the View Frustum. -- 2.1.4