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

Modifier Tools: Update wiki link

Bumped version to 0.2.4
Update wiki link
The paramaters in self.report are not needed
No other functional changes
parent 25fa2437
No related branches found
No related tags found
No related merge requests found
...@@ -20,14 +20,13 @@ ...@@ -20,14 +20,13 @@
bl_info = { bl_info = {
"name": "Modifier Tools", "name": "Modifier Tools",
"author": "Meta Androcto, saidenka", "author": "Meta Androcto, saidenka",
"version": (0, 2, 3), "version": (0, 2, 4),
"blender": (2, 77, 0), "blender": (2, 77, 0),
"location": "Properties > Modifiers", "location": "Properties > Modifiers",
"description": "Modifiers Specials Show/Hide/Apply Selected", "description": "Modifiers Specials Show/Hide/Apply Selected",
"warning": "", "warning": "",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6" "wiki_url": "https://wiki.blender.org/index.php/Extensions:2.6"
"/Py/Scripts/3D_interaction/modifier_tools", "/Py/Scripts/3D_interaction/modifier_tools",
"tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
"category": "3D View" "category": "3D View"
} }
...@@ -39,7 +38,7 @@ class ApplyAllModifiers(Operator): ...@@ -39,7 +38,7 @@ class ApplyAllModifiers(Operator):
bl_idname = "object.apply_all_modifiers" bl_idname = "object.apply_all_modifiers"
bl_label = "Apply All" bl_label = "Apply All"
bl_description = ("Apply All modifiers of the selected object(s) \n" bl_description = ("Apply All modifiers of the selected object(s) \n"
"Active object has to have modifiers for menu to show up") "Active object has to have modifiers for the option to show up")
bl_options = {'REGISTER', 'UNDO'} bl_options = {'REGISTER', 'UNDO'}
def execute(self, context): def execute(self, context):
...@@ -59,8 +58,10 @@ class ApplyAllModifiers(Operator): ...@@ -59,8 +58,10 @@ class ApplyAllModifiers(Operator):
contx['modifier'] = mod contx['modifier'] = mod
is_mod = True is_mod = True
try: try:
bpy.ops.object.modifier_apply(contx, apply_as='DATA', bpy.ops.object.modifier_apply(
modifier=contx['modifier'].name) contx, apply_as='DATA',
modifier=contx['modifier'].name
)
except: except:
obj_name = getattr(obj, "name", "NO NAME") obj_name = getattr(obj, "name", "NO NAME")
collect_names.append(obj_name) collect_names.append(obj_name)
...@@ -73,18 +74,19 @@ class ApplyAllModifiers(Operator): ...@@ -73,18 +74,19 @@ class ApplyAllModifiers(Operator):
else: else:
message_a = "No Modifiers on Selected Objects" message_a = "No Modifiers on Selected Objects"
else: else:
self.report(type={"INFO"}, message="No Selection. No changes applied") self.report({"INFO"}, "No Selection. No changes applied")
return {'CANCELLED'} return {'CANCELLED'}
# applying failed for some objects, show report # applying failed for some objects, show report
message_obj = (",".join(collect_names) if collect_names and message_obj = (",".join(collect_names) if collect_names and
len(collect_names) < 8 else "some objects (Check System Console)") len(collect_names) < 8 else "some objects (Check System Console)")
self.report(type={"INFO"}, message=(message_a if not message_b else self.report({"INFO"},
(message_a if not message_b else
"Applying modifiers failed for {}".format(message_obj))) "Applying modifiers failed for {}".format(message_obj)))
if (collect_names and message_obj == "some objects (Check System Console)"): if (collect_names and message_obj == "some objects (Check System Console)"):
print("\n** MODIFIERS TOOLS REPORT **\n\nApplying failed on:" print("\n[Modifier Tools]\n\nApplying failed on:"
"\n\n{} \n".format(", ".join(collect_names))) "\n\n{} \n".format(", ".join(collect_names)))
return {'FINISHED'} return {'FINISHED'}
...@@ -116,10 +118,10 @@ class DeleteAllModifiers(Operator): ...@@ -116,10 +118,10 @@ class DeleteAllModifiers(Operator):
else: else:
message_a = "No Modifiers on Selected Objects" message_a = "No Modifiers on Selected Objects"
else: else:
self.report(type={"INFO"}, message="No Selection. No changes applied") self.report({"INFO"}, "No Selection. No changes applied")
return {'CANCELLED'} return {'CANCELLED'}
self.report(type={"INFO"}, message=message_a) self.report({"INFO"}, message_a)
return {'FINISHED'} return {'FINISHED'}
...@@ -151,11 +153,11 @@ class ToggleApplyModifiersView(Operator): ...@@ -151,11 +153,11 @@ class ToggleApplyModifiersView(Operator):
mod.show_viewport = is_apply mod.show_viewport = is_apply
if is_apply: if is_apply:
message_a = "Displaying modifiers in the 3d View" message_a = "Displaying modifiers in the 3D View"
else: else:
message_a = "Hiding modifiers in the 3d View" message_a = "Hiding modifiers in the 3D View"
self.report(type={"INFO"}, message=message_a) self.report({"INFO"}, message_a)
return {'FINISHED'} return {'FINISHED'}
...@@ -184,7 +186,7 @@ class ToggleAllShowExpanded(Operator): ...@@ -184,7 +186,7 @@ class ToggleAllShowExpanded(Operator):
for mod in obj.modifiers: for mod in obj.modifiers:
mod.show_expanded = not is_close mod.show_expanded = not is_close
else: else:
self.report(type={'WARNING'}, message="Not a single modifier to Expand/Collapse") self.report({'WARNING'}, "Not a single modifier to Expand/Collapse")
return {'CANCELLED'} return {'CANCELLED'}
for area in context.screen.areas: for area in context.screen.areas:
......
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