]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_mesh.py
Include only tangent in mesh data and calculate binormal on the fly
[libs/gl.git] / blender / io_mspgl / export_mesh.py
index 68d93cbc525b9b3872e209c58a33bb7548ca0cba..16f9514a97402443cadd8bb12d2ce1ca6e2170ee 100644 (file)
@@ -73,9 +73,8 @@ class MeshExporter:
                                        st.append(Token("TEXCOORD"+size))
                                else:
                                        st.append(Token("TEXCOORD{}_{}".format(size, u.unit)))
-                       if mesh.tbn_vecs:
+                       if mesh.tangent_vecs:
                                st.append(Token("TANGENT3"))
-                               st.append(Token("BINORMAL3"))
                if mesh.vertex_groups:
                        st.append(Token("GROUP{}".format(mesh.max_groups_per_vertex)))
                        st.append(Token("WEIGHT{}".format(mesh.max_groups_per_vertex)))
@@ -85,7 +84,6 @@ class MeshExporter:
                color = None
                uvs = [None]*len(mesh.uv_layers)
                tan = None
-               bino = None
                group = None
                weight = None
                for v in mesh.vertices:
@@ -102,13 +100,10 @@ class MeshExporter:
                                        else:
                                                st.sub.append(Statement("multitexcoord", u.unit, *v.uvs[i]))
                                        uvs[i] = v.uvs[i]
-                       if mesh.tbn_vecs:
+                       if mesh.tangent_vecs:
                                if v.tan!=tan:
                                        st.sub.append(Statement("tangent", *v.tan))
                                        tan = v.tan
-                               if v.bino!=bino:
-                                       st.sub.append(Statement("binormal", *v.bino))
-                                       bino = v.bino
                        if mesh.vertex_groups:
                                v_group = [g.group for g in v.groups]
                                v_weight = [g.weight for g in v.groups]