Add a 'Apply and Delete All' operation to shapekeys.

Adds a new option to the 'Delete ShpaKeys' operator, which first applies
the current mix to the object data, before removing all shapekeys.

Request from @JulienKaspar from Blender studio.

Reviewed By: JulienKaspar

Differential Revision: https://developer.blender.org/D15443
This commit is contained in:
Bastien Montagne
2022-07-20 10:45:23 +02:00
committed by Bastien Montagne
parent ecf4f4a71f
commit 92ca920c52
5 changed files with 129 additions and 49 deletions

View File

@@ -58,7 +58,12 @@ class MESH_MT_shape_key_context_menu(Menu):
layout.operator("object.join_shapes")
layout.operator("object.shape_key_transfer")
layout.separator()
layout.operator("object.shape_key_remove", icon='X', text="Delete All Shape Keys").all = True
op = layout.operator("object.shape_key_remove", icon='X', text="Delete All Shape Keys")
op.all = True
op.apply_mix = False
op = layout.operator("object.shape_key_remove", text="Apply All Shape Keys")
op.all = True
op.apply_mix = True
layout.separator()
layout.operator("object.shape_key_move", icon='TRIA_UP_BAR', text="Move to Top").type = 'TOP'
layout.operator("object.shape_key_move", icon='TRIA_DOWN_BAR', text="Move to Bottom").type = 'BOTTOM'