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:
authorBastien Montagne <montagne29@wanadoo.fr>2011-11-15 18:37:58 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-11-15 18:37:58 +0400
commit28e9dc5ba7c5bc871f1ca285875356c6cc0b91ea (patch)
tree8c5abdce33d71a21fa62a0a0febc8ce3fd9957f8 /object_fracture
parenta7c0f11563e6daa6b6b29c66a9062a718d702128 (diff)
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).
Diffstat (limited to 'object_fracture')
-rw-r--r--object_fracture/fracture_ops.py19
1 files 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