Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #73 from le717/restore-speed-take-2
Browse files Browse the repository at this point in the history
Restore import speed - Take 2
  • Loading branch information
Triangle717 committed May 15, 2014
2 parents 7deed48 + 680dc23 commit 723d8e9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions import_ldraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,25 +795,26 @@ def create_model(self, scale, context):
for cur_obj in objects:
cur_obj.select = True
bpy.context.scene.objects.active = cur_obj
if bpy.ops.object.mode_set.poll():

if bpy.ops.object.mode_set.poll():
# Change to edit mode
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')

# Remove doubles, calculate normals
bpy.ops.mesh.remove_doubles(threshold=0.01)
bpy.ops.mesh.normals_make_consistent()
if bpy.ops.object.mode_set.poll():

if bpy.ops.object.mode_set.poll():
# Go back to object mode, set origin to geometry
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')

# Set smooth shading
bpy.ops.object.shade_smooth()

# Add 30 degree edge split modifier to all bricks
# Add 30 degree edge split modifier to all bricks
for cur_obj in objects:
edges = cur_obj.modifiers.new(
"Edge Split", type='EDGE_SPLIT')
edges.split_angle = 0.523599
Expand Down

0 comments on commit 723d8e9

Please sign in to comment.