]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_mesh.py
Auto smooth angle is stored in radians, not degrees
[libs/gl.git] / blender / io_mspgl / export_mesh.py
index 0d2e66ab442206b9f2454baa0ffe2e37f7557cb3..3da09f9ab92d99cc918cf7375ed692e3f12aeb63 100644 (file)
@@ -286,19 +286,19 @@ class MeshExporter:
                if self.object:
                        out_file.begin("mesh")
 
-               fmt = "NORMAL3"
+               fmt = ["NORMAL3"]
                if texunits:
                        for i, u in texunits:
                                if u.unit==0:
-                                       fmt += "_TEXCOORD2"
+                                       fmt.append("TEXCOORD2")
                                else:
-                                       fmt += "_TEXCOORD2%d"%u.unit
+                                       fmt.append("TEXCOORD2_%d"%u.unit)
                        if self.tbn_vecs:
-                               fmt += "_ATTRIB33_ATTRIB34"
+                               fmt += ["TANGENT3", "BINORMAL3"]
                if self.export_groups:
-                       fmt += "_ATTRIB%d5"%(self.max_groups*2)
-               fmt += "_VERTEX3"
-               out_file.begin("vertices", fmt)
+                       fmt.append("ATTRIB%d_5"%(self.max_groups*2))
+               fmt.append("VERTEX3")
+               out_file.begin("vertices", *fmt)
                normal = None
                uvs = [None]*len(texunits)
                tan = None
@@ -317,10 +317,10 @@ class MeshExporter:
                                        uvs[i] = v.uvs[i]
                        if self.tbn_vecs:
                                if v.tan!=tan:
-                                       out_file.write("attrib3", 3, *v.tan)
+                                       out_file.write("tangent3", *v.tan)
                                        tan = v.tan
                                if v.bino!=bino:
-                                       out_file.write("attrib3", 4, *v.bino)
+                                       out_file.write("binormal3", *v.bino)
                                        bino = v.bino
                        if self.export_groups:
                                group_attr = [(group_index_map[g.group], g.weight*v.group_weight_scale) for g in v.groups[:self.max_groups]]