island.append(face)
for n in f.get_neighbors():
- n.flag = True
- queue.append(n)
+ if not n.flag:
+ n.flag = True
+ queue.append(n)
# Unflag the island for the next phase
for f in island:
if f.flag:
continue
- score = sum(n.flag for n in f.get_neighbors())
+ score = sum(not n.flag for n in f.get_neighbors())
if score>0 and score<best:
face = f
best = score
strip = mesh.create_strip(face, self.max_strip_len)
if strip:
island_strips.append(strip)
+ else:
+ face.flag = True
else:
# Couldn't find a candidate face for starting a strip, so we're
# done with this island
else:
out_file.write("multitexcoord2", u.unit, *v.uvs[i])
uvs[i] = v.uvs[i]
- if v.tan!=tan:
- out_file.write("attrib3", 3, *v.tan)
- tan = v.tan
- if v.bino!=bino:
- out_file.write("attrib3", 4, *v.bino)
- bino = v.bino
+ if self.tbn_vecs:
+ if v.tan!=tan:
+ out_file.write("attrib3", 3, *v.tan)
+ tan = v.tan
+ if v.bino!=bino:
+ out_file.write("attrib3", 4, *v.bino)
+ bino = v.bino
out_file.write("vertex3", *v.co)
out_file.end()
for s in strips: