Fix T42375: Hallo Objet fracture tool error.

Add poll funcs to prevent using fracture op with non-mesh objects.
This commit is contained in:
Bastien Montagne 2014-11-07 11:06:50 +01:00
parent fb2f011fd8
commit 63aba82339
Notes: blender-bot 2023-02-14 20:02:03 +01:00
Referenced by commit fea70a40: Correction to own rBA63aba82339 - do not loop on objects in poll func!
Referenced by commit fea70a40, Correction to own rBA63aba82339 - do not loop on objects in poll func!
Referenced by issue #42375, Hallo  Objet fracture tool  error
2 changed files with 25 additions and 4 deletions

View File

@ -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",
}

View File

@ -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)