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>2016-02-22 10:17:56 +0300
committerChris Foster <cdbfoster@gmail.com>2016-02-22 10:17:56 +0300
commit7b4471e620748073ef3b2d68533a270ca4fbffa0 (patch)
treefda2093a8e66b18b6d6d49724bc67a92031d59c8
parentbdb3dd8ab34ee487e1791243aed594085bbcf965 (diff)
Reduce reallocations by using lists instead of tuples. This yields massive performance improvements when exporting large files. Thanks to Rafał Brzeżański for pointing this out.
-rw-r--r--io_scene_x/export_x.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/io_scene_x/export_x.py b/io_scene_x/export_x.py
index 08a77176..bde0fd26 100644
--- a/io_scene_x/export_x.py
+++ b/io_scene_x/export_x.py
@@ -427,10 +427,11 @@ class MeshExportObject(ExportObject):
def __init__(self, Mesh):
MeshExportObject._MeshEnumerator.__init__(self, Mesh)
- self.vertices = tuple()
+ self.vertices = []
for Polygon in Mesh.polygons:
- self.vertices += tuple(Mesh.vertices[VertexIndex]
- for VertexIndex in Polygon.vertices)
+ self.vertices += [Mesh.vertices[VertexIndex]
+ for VertexIndex in Polygon.vertices]
+ self.vertices = tuple(self.vertices)
self.PolygonVertexIndices = []
Index = 0