[Bf-extensions-cvs] [fea70a4] master: Correction to own rBA63aba82339 - do not loop on objects in poll func!

Bastien Montagne noreply at git.blender.org
Fri Nov 7 16:49:20 CET 2014


Commit: fea70a406b9715a02908c4da88517cd93e1f1ada
Author: Bastien Montagne
Date:   Fri Nov 7 16:48:18 2014 +0100
Branches: master
https://developer.blender.org/rBAfea70a406b9715a02908c4da88517cd93e1f1ada

Correction to own rBA63aba82339 - do not loop on objects in poll func!

Thanks to Campbell for the headup.

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

M	object_fracture/fracture_ops.py

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

diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py
index b77f4b5..74558da 100644
--- a/object_fracture/fracture_ops.py
+++ b/object_fracture/fracture_ops.py
@@ -377,13 +377,9 @@ class FractureSimple(bpy.types.Operator):
 
     @classmethod
     def poll(clss, context):
-        if not context.active_object or context.active_object.mode != 'OBJECT':
+        ob = context.active_object
+        if context.mode != 'OBJECT' or not ob or ob.type != 'MESH':
             return False
-
-        for ob in context.scene.objects:
-            if ob.select:
-                if ob.type != 'MESH':
-                    return False
         return True
 
     def execute(self, context):
@@ -419,13 +415,9 @@ class FractureGroup(bpy.types.Operator):
 
     @classmethod
     def poll(clss, context):
-        if not context.active_object or context.active_object.mode != 'OBJECT':
+        ob = context.active_object
+        if context.mode != 'OBJECT' or not ob or ob.type != 'MESH':
             return False
-
-        for ob in context.scene.objects:
-            if ob.select:
-                if ob.type != 'MESH':
-                    return False
         return True
 
     def execute(self, context):



More information about the Bf-extensions-cvs mailing list