]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix exporting meshes without UV coordinates
authorMikko Rasa <tdb@tdb.fi>
Tue, 6 May 2014 21:13:35 +0000 (00:13 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 6 May 2014 21:16:45 +0000 (00:16 +0300)
blender/io_mspgl/export_mesh.py

index cc8ee6ff9abbc1696fe2e13b16e752761ae7c58c..f429ff3199b290d9b2a23e969e3ac3497435d2e5 100644 (file)
@@ -312,7 +312,7 @@ class MeshExporter:
                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
@@ -321,7 +321,7 @@ class MeshExporter:
                                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: