[Bf-extensions-cvs] [63aba82] master: Fix T42375: Hallo Objet fracture tool error.

Bastien Montagne noreply at git.blender.org
Fri Nov 7 11:07:39 CET 2014


Commit: 63aba8233910abb8e2a4cb1bfc323b5a77801cd4
Author: Bastien Montagne
Date:   Fri Nov 7 11:06:50 2014 +0100
Branches: master
https://developer.blender.org/rBA63aba8233910abb8e2a4cb1bfc323b5a77801cd4

Fix T42375: Hallo Objet fracture tool error.

Add poll funcs to prevent using fracture op with non-mesh objects.

===================================================================

M	object_fracture/__init__.py
M	object_fracture/fracture_ops.py

===================================================================

diff --git a/object_fracture/__init__.py b/object_fracture/__init__.py
index 229c591..5e1e3f0 100644
--- a/object_fracture/__init__.py
+++ b/object_fracture/__init__.py
@@ -19,13 +19,12 @@
 bl_info = {
     "name": "Fracture Tools",
     "author": "pildanovak",
-    "version": (2, 0),
-    "blender": (2, 57, 0),
+    "version": (2, 0, 1),
+    "blender": (2, 72, 0),
     "location": "Search > Fracture Object & Add > Fracture Helper Objects",
     "description": "Fractured Object, Bomb, Projectile, Recorder",
     "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/Object/Fracture",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Fracture",
     "category": "Object",
 }
 
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py
index 87588aa..b77f4b5 100644
--- a/object_fracture/fracture_ops.py
+++ b/object_fracture/fracture_ops.py
@@ -375,6 +375,17 @@ class FractureSimple(bpy.types.Operator):
         max=3.0,
         default=0.5)
 
+    @classmethod
+    def poll(clss, context):
+        if not context.active_object or context.active_object.mode != 'OBJECT':
+            return False
+
+        for ob in context.scene.objects:
+            if ob.select:
+                if ob.type != 'MESH':
+                    return False
+        return True
+
     def execute(self, context):
         #getIslands(context.object)
         if self.exe:
@@ -406,6 +417,17 @@ class FractureGroup(bpy.types.Operator):
 #                         items=e,
 #                         description='Specify the group used for fracturing')
 
+    @classmethod
+    def poll(clss, context):
+        if not context.active_object or context.active_object.mode != 'OBJECT':
+            return False
+
+        for ob in context.scene.objects:
+            if ob.select:
+                if ob.type != 'MESH':
+                    return False
+        return True
+
     def execute(self, context):
         #getIslands(context.object)



More information about the Bf-extensions-cvs mailing list