Skip to content
Snippets Groups Projects
Commit b04ab01f authored by lijenstina's avatar lijenstina
Browse files

Modifier Tools: Missing Poll checks for the Search

Just the standard calling from out of context
within the Search Operator
Bumped the version to 0.2.3
parent 80477b28
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
bl_info = {
"name": "Modifier Tools",
"author": "Meta Androcto, saidenka",
"version": (0, 2, 2),
"version": (0, 2, 3),
"blender": (2, 77, 0),
"location": "Properties > Modifiers",
"description": "Modifiers Specials Show/Hide/Apply Selected",
......@@ -129,6 +129,10 @@ class ToggleApplyModifiersView(Operator):
bl_description = "Shows/Hide modifiers of the active / selected object(s) in 3d View"
bl_options = {'REGISTER'}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
is_apply = True
message_a = ""
......@@ -161,6 +165,10 @@ class ToggleAllShowExpanded(Operator):
bl_description = "Expand/Collapse Modifier Stack"
bl_options = {'REGISTER'}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
obj = context.active_object
if (len(obj.modifiers)):
......@@ -176,7 +184,7 @@ class ToggleAllShowExpanded(Operator):
for mod in obj.modifiers:
mod.show_expanded = not is_close
else:
self.report(type={'WARNING'}, message="Not a single modifier")
self.report(type={'WARNING'}, message="Not a single modifier to Expand/Collapse")
return {'CANCELLED'}
for area in context.screen.areas:
......@@ -234,5 +242,6 @@ def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment