diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-07 18:48:18 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-07 18:48:18 +0300 |
commit | fea70a406b9715a02908c4da88517cd93e1f1ada (patch) | |
tree | d4ab5e50b436389bb02e07c867686302048e42a6 /object_fracture/fracture_ops.py | |
parent | 63aba8233910abb8e2a4cb1bfc323b5a77801cd4 (diff) |
Correction to own rBA63aba82339 - do not loop on objects in poll func!
Thanks to Campbell for the headup.
Diffstat (limited to 'object_fracture/fracture_ops.py')
-rw-r--r-- | object_fracture/fracture_ops.py | 16 |
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): |