diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-07 13:06:50 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-07 13:06:50 +0300 |
commit | 63aba8233910abb8e2a4cb1bfc323b5a77801cd4 (patch) | |
tree | 08e31c8dc829451cd470fa00b93989699ca55aeb /object_fracture/fracture_ops.py | |
parent | fb2f011fd825e72434ac78a5919edb8f3527bfe8 (diff) |
Fix T42375: Hallo Objet fracture tool error.
Add poll funcs to prevent using fracture op with non-mesh objects.
Diffstat (limited to 'object_fracture/fracture_ops.py')
-rw-r--r-- | object_fracture/fracture_ops.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index 87588aa4..b77f4b5f 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) |