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

Restore import speed - Take 2 #73

Merged
merged 1 commit into from
May 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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