[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2613] trunk/py/scripts/addons/ object_fracture/fracture_ops.py: Fix [#29271] Fracture Object Script broken .

Bastien Montagne montagne29 at wanadoo.fr
Tue Nov 15 15:37:59 CET 2011


Revision: 2613
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2613
Author:   mont29
Date:     2011-11-15 14:37:58 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
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).

Modified Paths:
--------------
    trunk/py/scripts/addons/object_fracture/fracture_ops.py

Modified: trunk/py/scripts/addons/object_fracture/fracture_ops.py
===================================================================
--- trunk/py/scripts/addons/object_fracture/fracture_ops.py	2011-11-15 03:00:46 UTC (rev 2612)
+++ trunk/py/scripts/addons/object_fracture/fracture_ops.py	2011-11-15 14:37:58 UTC (rev 2613)
@@ -31,13 +31,9 @@
             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 @@
             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 @@
                 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



More information about the Bf-extensions-cvs mailing list