X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_mesh.py;h=541874b2bd2018c052d286962956a0a0a45f77b6;hb=fc7566b2d83eb5b73aa516b045116e02150df83c;hp=1652c1a494756eec3c772718b01897297046e444;hpb=1d0b0fcb7ad573053a8730a90f7fb33061038db2;p=libs%2Fgl.git diff --git a/blender/io_mspgl/export_mesh.py b/blender/io_mspgl/export_mesh.py index 1652c1a4..541874b2 100644 --- a/blender/io_mspgl/export_mesh.py +++ b/blender/io_mspgl/export_mesh.py @@ -64,6 +64,7 @@ class MeshExporter: cache = VertexCache(self.cache_size) island = [] + face_neighbors = [] island_strips = [] while 1: if not island: @@ -83,11 +84,13 @@ class MeshExporter: face = queue.pop(0) island.append(face) - for n in f.get_neighbors(): + for n in face.get_neighbors(): if not n.flag: n.flag = True queue.append(n) + face_neighbors = [f.get_neighbors() for f in island] + # Unflag the island for the next phase for f in island: f.flag = False @@ -97,11 +100,11 @@ class MeshExporter: # or along borders of a non-closed island. best = 5 face = None - for f in island: + for i, f in enumerate(island): if f.flag: continue - score = sum(not n.flag for n in f.get_neighbors()) + score = sum(not n.flag for n in face_neighbors[i]) if score>0 and score