[Bf-extensions-cvs] [0974dbb] master: Reverse the winding order of faces when exporting to a left-handed system.
Chris Foster
noreply at git.blender.org
Thu Jul 31 20:08:07 CEST 2014
Commit: 0974dbb3cf24d1aff99ba3482549724b8925f814
Author: Chris Foster
Date: Thu Jul 31 14:07:35 2014 -0400
Branches: master
https://developer.blender.org/rBA0974dbb3cf24d1aff99ba3482549724b8925f814
Reverse the winding order of faces when exporting to a left-handed system.
===================================================================
M io_scene_x/export_x.py
===================================================================
diff --git a/io_scene_x/export_x.py b/io_scene_x/export_x.py
index 47d30a1..8f7d82d 100644
--- a/io_scene_x/export_x.py
+++ b/io_scene_x/export_x.py
@@ -476,6 +476,9 @@ class MeshExportObject(ExportObject):
self.Exporter.File.Write("{};".format(len(PolygonVertexIndices)))
+ if self.Config.CoordinateSystem == 'LEFT_HANDED':
+ PolygonVertexIndices = PolygonVertexIndices[::-1]
+
for VertexCountIndex, VertexIndex in \
enumerate(PolygonVertexIndices):
@@ -584,6 +587,9 @@ class MeshExportObject(ExportObject):
for Index, Polygon in enumerate(MeshEnumerator.PolygonVertexIndices):
self.Exporter.File.Write("{};".format(len(Polygon)))
+ if self.Config.CoordinateSystem == 'LEFT_HANDED':
+ Polygon = Polygon[::-1]
+
for VertexCountIndex, VertexIndex in enumerate(Polygon):
if VertexCountIndex == len(Polygon) - 1:
self.Exporter.File.Write("{};".format(VertexIndex),
@@ -1373,3 +1379,4 @@ class Util:
return x.name
return sorted(List, key=SortKey)
+
More information about the Bf-extensions-cvs
mailing list