fmt.append("VERTEX3")
out_file.begin("vertices", *fmt)
normal = None
- uvs = [None]*(max(u[0] for u in texunits)+1)
+ uvs = {}
tan = None
bino = None
group = None
out_file.write("normal3", *v.normal)
normal = v.normal
for i, u in texunits:
- if v.uvs[i]!=uvs[i]:
+ if v.uvs[i]!=uvs.get(i):
if u.unit==0 or force_unit0:
out_file.write("texcoord2", *v.uvs[i])
else:
out_file.end()
if self.export_lines and mesh.lines:
- out_file.write("batch", "LINES")
+ out_file.begin("batch", "LINES")
for l in mesh.lines:
out_file.write("indices", l.vertices[0].index, l.vertices[1].index)
out_file.end()