Skip to content

Commit

Permalink
fixed triangulate problem
Browse files Browse the repository at this point in the history
  • Loading branch information
jlamarche committed Apr 5, 2011
1 parent e817dd4 commit 7b06a67
Showing 1 changed file with 0 additions and 26 deletions.
Expand Up @@ -37,7 +37,6 @@ def triangulateNMesh(object):
for i in scene.objects: i.select = False #deselect all objects for i in scene.objects: i.select = False #deselect all objects
object.select = True object.select = True
scene.objects.active = object #set the mesh object to current scene.objects.active = object #set the mesh object to current
# bpy.ops.object.mode_set(mode='OBJECT')
print("Checking mesh if needs to convert quad to Tri...") print("Checking mesh if needs to convert quad to Tri...")
for face in object.data.faces: for face in object.data.faces:
if (len(face.vertices) > 3): if (len(face.vertices) > 3):
Expand Down Expand Up @@ -80,21 +79,6 @@ def do_export(context, props, filepath):
me_ob = triangulateNMesh(ob) me_ob = triangulateNMesh(ob)
current_scene = context.scene current_scene = context.scene
apply_modifiers = props.apply_modifiers apply_modifiers = props.apply_modifiers
#
# bpy.ops.object.mode_set(mode='OBJECT')
# me_da = ob.data.copy() #copy data
# me_ob = ob.copy() #copy object


# bpy.context.scene.objects.link(me_ob)
# for i in current_scene.objects: i.select = False #deselect all objects
# me_ob.select = True
# current_scene.objects.active = me_ob #set the mesh object to current
# bpy.ops.object.mode_set(mode='EDIT') #Operators
# bpy.ops.mesh.select_all(action='SELECT')#select all the face/vertex/edge
# bpy.ops.mesh.quads_convert_to_tris() #Operators
# bpy.context.scene.update()
# bpy.ops.object.mode_set(mode='OBJECT') # set it in object


mesh = me_ob.to_mesh(current_scene, apply_modifiers, 'PREVIEW') mesh = me_ob.to_mesh(current_scene, apply_modifiers, 'PREVIEW')


Expand All @@ -105,16 +89,6 @@ def do_export(context, props, filepath):


if props.rot_x90: if props.rot_x90:
mesh.transform(mat_x90) mesh.transform(mat_x90)

#mesh.select = True
#
# #current_scene.objects.active = mesh #set the mesh object to current
# bpy.ops.object.mode_set(mode='EDIT') #Operators
# bpy.ops.mesh.select_all(action='SELECT')#select all the face/vertex/edge
# bpy.ops.mesh.quads_convert_to_tris() #Operators
# current_scene.update()
# bpy.ops.object.mode_set(mode='OBJECT') # set it in object
# bpy.ops.mesh.quads_convert_to_tris()


file = open(filepath, "wb") file = open(filepath, "wb")
theHeader = '//If not using MC3D, change 1 to 0 to add needed types\n#if 1\n\t#import "MC3DTypes.h"\n#else\n\ theHeader = '//If not using MC3D, change 1 to 0 to add needed types\n#if 1\n\t#import "MC3DTypes.h"\n#else\n\
Expand Down

0 comments on commit 7b06a67

Please sign in to comment.