diff options
author | lijenstina <lijenstina@gmail.com> | 2017-03-03 07:19:55 +0300 |
---|---|---|
committer | lijenstina <lijenstina@gmail.com> | 2017-03-03 07:19:55 +0300 |
commit | b04ab01f947384013c459869f6026c75230e49f7 (patch) | |
tree | c302d56d76582afbaf0c4ae20845036c65c00cab | |
parent | 80477b2824fbc355305809c9729fd2fbba79acfa (diff) |
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
-rw-r--r-- | space_view3d_modifier_tools.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/space_view3d_modifier_tools.py b/space_view3d_modifier_tools.py index 0aa56beb..edc2139b 100644 --- a/space_view3d_modifier_tools.py +++ b/space_view3d_modifier_tools.py @@ -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() |