From 7132c12252110a27494b4ed0b7398b04967bcf2a Mon Sep 17 00:00:00 2001 From: Tristan Strathearn Date: Sun, 19 May 2024 09:09:14 +1000 Subject: [PATCH] feat: add a hard apply & duplicate mesh alternative mode to the apply modifiers operator --- utils/apply_modifiers.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/apply_modifiers.py b/utils/apply_modifiers.py index bd336b2..995e1de 100644 --- a/utils/apply_modifiers.py +++ b/utils/apply_modifiers.py @@ -33,7 +33,8 @@ class ND_OT_apply_modifiers(bpy.types.Operator): bl_idname = "nd.apply_modifiers" bl_label = "Apply Modifiers" bl_description = """Prepare the selected object(s) for destructive operations by applying applicable modifiers -SHIFT — Hard apply (apply all modifiers)""" +SHIFT — Hard apply (apply all modifiers) +ALT — Hard apply (duplicate mesh)""" bl_options = {'UNDO'} @@ -44,6 +45,9 @@ def poll(cls, context): def execute(self, context): + if self.duplicate: + bpy.ops.object.duplicate() + bpy.ops.object.make_single_user(object=True, obdata=True, material=False, animation=False, obdata_animation=False) for obj in context.selected_objects: @@ -56,6 +60,7 @@ def execute(self, context): def invoke(self, context, event): self.hard_apply = event.shift + self.duplicate = event.alt return self.execute(context)