Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-02-10 16:58:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-10 16:58:02 +0400
commit8c2a9a541c38332f57759d066e81915f95bf1391 (patch)
treeca6a21d2e444fc53a52f33ade87df417f90d7172
parentd22b2014a290f23b5f563520b211ea6c341a3581 (diff)
triangulate works again
-rw-r--r--io_scene_obj/export_obj.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 2d2ed638..e57d852c 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -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()