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 | |
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')
-rw-r--r-- | object_fracture/__init__.py | 7 | ||||
-rw-r--r-- | object_fracture/fracture_ops.py | 22 |
2 files changed, 25 insertions, 4 deletions
diff --git a/object_fracture/__init__.py b/object_fracture/__init__.py index 229c5913..5e1e3f07 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 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) |