[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4521] trunk/py/scripts/addons/ io_scene_x/export_x.py: Fixed face definition separator in mesh and normal face definitions.

Chris Foster cdbfoster at gmail.com
Tue May 14 00:39:33 CEST 2013


Revision: 4521
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4521
Author:   kiravakaan
Date:     2013-05-13 22:39:33 +0000 (Mon, 13 May 2013)
Log Message:
-----------
Fixed face definition separator in mesh and normal face definitions.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_x/export_x.py

Modified: trunk/py/scripts/addons/io_scene_x/export_x.py
===================================================================
--- trunk/py/scripts/addons/io_scene_x/export_x.py	2013-05-12 23:41:50 UTC (rev 4520)
+++ trunk/py/scripts/addons/io_scene_x/export_x.py	2013-05-13 22:39:33 UTC (rev 4521)
@@ -471,9 +471,15 @@
             
             PolygonVertexIndexes = PolygonVertexIndexes[::-1]
             
-            for VertexIndex in PolygonVertexIndexes:
-                self.Exporter.File.Write("{},".format(VertexIndex),
-                    Indent=False)
+            for VertexCountIndex, VertexIndex in \
+                enumerate(PolygonVertexIndexes):
+
+                if VertexCountIndex == len(PolygonVertexIndexes) - 1:
+                    self.Exporter.File.Write("{};".format(VertexIndex),
+                        Indent=False)
+                else:
+                    self.Exporter.File.Write("{},".format(VertexIndex),
+                        Indent=False)
             
             if Index == PolygonCount - 1:
                 self.Exporter.File.Write(";\n", Indent=False)
@@ -569,9 +575,13 @@
             self.Exporter.File.Write("{};".format(len(Polygon)))
             
             # Reverse the winding order
-            for VertexIndex in Polygon[::-1]:
-                self.Exporter.File.Write("{},".format(VertexIndex),
-                    Indent=False)
+            for VertexCountIndex, VertexIndex in enumerate(Polygon[::-1]):
+                if VertexCountIndex == len(Polygon) - 1:
+                    self.Exporter.File.Write("{};".format(VertexIndex),
+                        Indent=False)
+                else:
+                    self.Exporter.File.Write("{},".format(VertexIndex),
+                        Indent=False)
             
             if Index == FaceCount - 1:
                 self.Exporter.File.Write(";\n", Indent=False)



More information about the Bf-extensions-cvs mailing list