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>2014-11-07 18:48:18 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-07 18:48:18 +0300
commitfea70a406b9715a02908c4da88517cd93e1f1ada (patch)
treed4ab5e50b436389bb02e07c867686302048e42a6
parent63aba8233910abb8e2a4cb1bfc323b5a77801cd4 (diff)
Correction to own rBA63aba82339 - do not loop on objects in poll func!
Thanks to Campbell for the headup.
-rw-r--r--object_fracture/fracture_ops.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py
index b77f4b5f..74558dad 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):