Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Foster <cdbfoster@gmail.com>2014-07-31 22:07:35 +0400
committerChris Foster <cdbfoster@gmail.com>2014-07-31 22:07:35 +0400
commit0974dbb3cf24d1aff99ba3482549724b8925f814 (patch)
tree48db88d32e3e25af1d90b2229b4bdebee47dbe40 /io_scene_x
parentdce0ada8550326e919a30cba04421b161db94634 (diff)
Reverse the winding order of faces when exporting to a left-handed system.
Diffstat (limited to 'io_scene_x')
-rw-r--r--io_scene_x/export_x.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/io_scene_x/export_x.py b/io_scene_x/export_x.py
index 47d30a10..8f7d82d5 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)
+