From: Antonio Ospite Date: Mon, 5 Jun 2006 21:15:37 +0000 (+0200) Subject: Fix handling Text and Curve objects X-Git-Tag: vrm-0.3~29 X-Git-Url: https://git.ao2.it/vrm.git/commitdiff_plain/e0cb391c169b6ed0543bcec9b91b7a65f86b8fa8?ds=inline 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 --- 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.