]> git.tdb.fi Git - libs/gl.git/commitdiff
Raise an exception if attempting to export a mesh with ngons
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Apr 2015 20:44:06 +0000 (23:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Apr 2015 20:44:06 +0000 (23:44 +0300)
Otherwise there will be a much more confusing errors down the line

blender/io_mspgl/mesh.py

index 3ad3cecc7c570d47b3d8cad22c3dbf0949c11b83..04b2b51fb075c519f17e3a44e93e598de312510e 100644 (file)
@@ -148,6 +148,8 @@ class Mesh:
                self.assign_texture_units()
 
                for f in self.faces:
+                       if len(f.vertices)>4:
+                               raise ValueError("Ngons are not supported")
                        f.vertices = [self.vertices[i] for i in f.vertices]
                        for v in f.vertices:
                                v.faces.append(f)