From 28e9dc5ba7c5bc871f1ca285875356c6cc0b91ea Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 15 Nov 2011 14:37:58 +0000 Subject: Fix [#29271] Fracture Object Script broken. The fracture object was always created on layer 1 only (when this layer is not visible, ops.object.editmode_toggle hence failed). Now creating the fracture objects on current active layer(s). --- object_fracture/fracture_ops.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index d04a3b92..c9fcdecb 100644 --- a/object_fracture/fracture_ops.py +++ b/object_fracture/fracture_ops.py @@ -31,13 +31,9 @@ def create_cutter(context, crack_type, scale, roughness): enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0), - layers=(True, False, False, False, - False, False, False, False, - False, False, False, False, - False, False, False, False, - False, False, False, False)) + layers=context.scene.layers) - for v in context.scene.objects.active.data.vertices: + for v in context.active_object.data.vertices: v.co[0] += 1.0 v.co *= scale @@ -62,18 +58,14 @@ def create_cutter(context, crack_type, scale, roughness): enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0), - layers=(True, False, False, False, - False, False, False, False, - False, False, False, False, - False, False, False, False, - False, False, False, False)) + layers=context.scene.layers) bpy.ops.object.editmode_toggle() bpy.ops.mesh.faces_shade_smooth() bpy.ops.uv.smart_project(angle_limit=66, island_margin=0) bpy.ops.object.editmode_toggle() - for v in context.scene.objects.active.data.vertices: + for v in context.active_object.data.vertices: v.co[0] += 1.0 v.co *= scale @@ -83,7 +75,8 @@ def create_cutter(context, crack_type, scale, roughness): v.co[1] += roughness * scale * 0.1 * (random.random() - 0.5) v.co[2] += roughness * scale * 0.1 * (random.random() - 0.5) - bpy.context.scene.objects.active.select = True + bpy.context.active_object.select = True +# bpy.context.scene.objects.active.select = True ''' # Adding fracture material -- cgit v1.2.3