Skip to content
Snippets Groups Projects
Commit 8c2a9a54 authored by Campbell Barton's avatar Campbell Barton
Browse files

triangulate works again

parent d22b2014
No related branches found
No related tags found
No related merge requests found
......@@ -34,15 +34,12 @@ def name_compat(name):
def mesh_triangulate(me):
pass
'''
import bmesh
bm = bmesh.new()
bm.from_mesh(me)
bmesh.ops.triangulate(bm, faces=bm.faces)
bm.to_mesh(me)
bm.free()
'''
def write_mtl(scene, filepath, path_mode, copy_set, mtl_dict):
......@@ -371,6 +368,10 @@ def write_file(filepath, objects, scene,
me.transform(EXPORT_GLOBAL_MATRIX * ob_mat)
if EXPORT_TRI:
# _must_ do this first since it re-allocs arrays
mesh_triangulate(me)
if EXPORT_UV:
faceuv = len(me.uv_textures) > 0
if faceuv:
......@@ -397,9 +398,6 @@ def write_file(filepath, objects, scene,
continue # dont bother with this mesh.
if EXPORT_TRI:
mesh_triangulate(me)
if EXPORT_NORMALS and face_index_pairs:
me.calc_normals()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment