[Bf-extensions-cvs] [b04ab01] master: Modifier Tools: Missing Poll checks for the Search
lijenstina
noreply at git.blender.org
Fri Mar 3 05:21:12 CET 2017
Commit: b04ab01f947384013c459869f6026c75230e49f7
Author: lijenstina
Date: Fri Mar 3 05:19:55 2017 +0100
Branches: master
https://developer.blender.org/rBAb04ab01f947384013c459869f6026c75230e49f7
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
===================================================================
M space_view3d_modifier_tools.py
===================================================================
diff --git a/space_view3d_modifier_tools.py b/space_view3d_modifier_tools.py
index 0aa56be..edc2139 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()
More information about the Bf-extensions-cvs
mailing list