diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2020-03-21 03:04:11 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2020-03-21 03:07:42 +0300 |
commit | a22cd6b6a95138d73e9e23f7ac0d40de17a5a25f (patch) | |
tree | 46e341c383b86726414d7303169e2040b574778e /release | |
parent | 9607e54985838006ca5695ed88bdaf81dda29b4c (diff) |
UI: Weight Paint: add a menu for locking and unlocking vertex groups.
This is a follow up on rBa1e50cfe6b4dbc360b6118c63a0dc7445023c37b
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index a2bfd711c04..0d51bef0d8d 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2939,6 +2939,32 @@ class VIEW3D_MT_gpencil_vertex_group(Menu): layout.operator("gpencil.vertex_group_deselect", text="Deselect") +class VIEW3D_MT_paint_weight_lock(Menu): + bl_label = "Vertex Group Locks" + + def draw(self, _context): + layout = self.layout + + op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All") + op.action, op.mask = 'LOCK', 'ALL' + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock All") + op.action, op.mask = 'UNLOCK', 'ALL' + op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Selected") + op.action, op.mask = 'LOCK', 'SELECTED' + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock Selected") + op.action, op.mask = 'UNLOCK', 'SELECTED' + op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Unselected") + op.action, op.mask = 'LOCK', 'UNSELECTED' + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock Unselected") + op.action, op.mask = 'UNLOCK', 'UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Lock Only Selected") + op.action, op.mask = 'LOCK', 'INVERT_UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Lock Only Unselected") + op.action, op.mask = 'UNLOCK', 'INVERT_UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Invert Locks") + op.action, op.mask = 'INVERT', 'ALL' + + class VIEW3D_MT_paint_weight(Menu): bl_label = "Weights" @@ -2980,6 +3006,8 @@ class VIEW3D_MT_paint_weight(Menu): layout.operator("paint.weight_set") + layout.menu("VIEW3D_MT_paint_weight_lock", text="Locks") + def draw(self, _context): self.draw_generic(self.layout, is_editmode=False) @@ -7302,6 +7330,7 @@ classes = ( VIEW3D_MT_vertex_group, VIEW3D_MT_gpencil_vertex_group, VIEW3D_MT_paint_weight, + VIEW3D_MT_paint_weight_lock, VIEW3D_MT_sculpt, VIEW3D_MT_sculpt_set_pivot, VIEW3D_MT_mask, |