From 75ebeaff4c90b1b74cfcb4a15db509d82d9e04b2 Mon Sep 17 00:00:00 2001 From: lijenstina <lijenstina@gmail.com> Date: Tue, 8 Nov 2016 01:53:01 +0100 Subject: [PATCH] Modifier Tools: Update to version 0.2.2 Add Viewport Visibility toggle for the active object (fixes the toggle not doing anything if there is no selection) Rephrase Visibility messages Clean up the cmd/ terminal failure message --- space_view3d_modifier_tools.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/space_view3d_modifier_tools.py b/space_view3d_modifier_tools.py index e34963bd6..0aa56beb6 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, 1), + "version": (0, 2, 2), "blender": (2, 77, 0), "location": "Properties > Modifiers", "description": "Modifiers Specials Show/Hide/Apply Selected", @@ -84,8 +84,8 @@ class ApplyAllModifiers(Operator): "Applying modifiers failed for {}".format(message_obj))) if (collect_names and message_obj == "some objects (Check System Console)"): - print("\n** MODIFIER SPECIALS REPORT **\n Applying failed on:\n", - ", ".join(collect_names)) + print("\n** MODIFIERS TOOLS REPORT **\n\nApplying failed on:" + "\n\n{} \n".format(", ".join(collect_names))) return {'FINISHED'} @@ -126,7 +126,7 @@ class DeleteAllModifiers(Operator): class ToggleApplyModifiersView(Operator): bl_idname = "object.toggle_apply_modifiers_view" bl_label = "Hide Viewport" - bl_description = "Shows/Hide modifier of the selected object(s) in 3d View" + bl_description = "Shows/Hide modifiers of the active / selected object(s) in 3d View" bl_options = {'REGISTER'} def execute(self, context): @@ -134,17 +134,22 @@ class ToggleApplyModifiersView(Operator): message_a = "" for mod in context.active_object.modifiers: - if (mod.show_viewport): + if mod.show_viewport: is_apply = False break + + # active object - no selection + for mod in context.active_object.modifiers: + mod.show_viewport = is_apply + for obj in context.selected_objects: for mod in obj.modifiers: mod.show_viewport = is_apply if is_apply: - message_a = "Applying modifiers to view" + message_a = "Displaying modifiers in the 3d View" else: - message_a = "Unregistered modifiers apply to the view" + message_a = "Hiding modifiers in the 3d View" self.report(type={"INFO"}, message=message_a) return {'FINISHED'} -- GitLab