X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2Fmesh.py;h=d05b9de844d91eeccf113fe9e961386041fb3baf;hb=1d0b0fcb7ad573053a8730a90f7fb33061038db2;hp=3ad3cecc7c570d47b3d8cad22c3dbf0949c11b83;hpb=af4769679fc41cfd95bb12777423f7672ba5f661;p=libs%2Fgl.git diff --git a/blender/io_mspgl/mesh.py b/blender/io_mspgl/mesh.py index 3ad3cecc..d05b9de8 100644 --- a/blender/io_mspgl/mesh.py +++ b/blender/io_mspgl/mesh.py @@ -45,6 +45,7 @@ class Vertex: def __init__(self, mv): if mv.__class__==Vertex: self._mvert = mv._mvert + self.co = mv.co self.normal = mv.normal self.uvs = mv.uvs[:] self.tan = mv.tan @@ -52,6 +53,8 @@ class Vertex: self.group_weight_scale = mv.group_weight_scale else: self._mvert = mv + self.co = mv.co + self.normal = mv.normal self.uvs = [] self.tan = None self.bino = None @@ -148,11 +151,20 @@ 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) for u in self.uv_layers: f.uvs.append([u.data[f.loop_indices[i]].uv for i in range(len(f.vertices))]) + if f.material_index