]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/mesh.py
Raise an exception if attempting to export a mesh with ngons
[libs/gl.git] / blender / io_mspgl / mesh.py
index 3a7400b7e6c2f296c2a582d42af19847bdaca143..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)
@@ -292,10 +294,10 @@ class Mesh:
                        if progress:
                                progress.set_progress(0.5+i*0.5/len(self.vertices))
 
-       def split_smooth(self, progress = None):
+       def split_smooth(self, progress=None):
                self.split_vertices(self.find_smooth_group, progress)
 
-       def split_uv(self, index, progress = None):
+       def split_uv(self, index, progress=None):
                self.split_vertices(self.find_uv_group, progress, index)
 
        def find_smooth_group(self, vertex, face):