forked from bartvdbraak/blender
Add keymap and menu entries for masking.
* Add CTRL+IKEY to invert the mask. * Add ALT+MKEY to clear the mask. * Change the 'Hide' menu in sculpt mode to 'Hide/Mask', adds entires for clearing, filling, and inverting the mask, as well as hiding masked regions.
This commit is contained in:
parent
415d346db6
commit
ee9f917f08
@ -55,7 +55,7 @@ class VIEW3D_HT_header(Header):
|
||||
if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
|
||||
sub.menu("VIEW3D_MT_brush")
|
||||
if mode_string == 'SCULPT':
|
||||
sub.menu("VIEW3D_MT_hide")
|
||||
sub.menu("VIEW3D_MT_hide_mask")
|
||||
else:
|
||||
sub.menu("VIEW3D_MT_object")
|
||||
|
||||
@ -1269,8 +1269,8 @@ class VIEW3D_MT_sculpt(Menu):
|
||||
layout.prop(sculpt, "use_deform_only")
|
||||
|
||||
|
||||
class VIEW3D_MT_hide(Menu):
|
||||
bl_label = "Hide"
|
||||
class VIEW3D_MT_hide_mask(Menu):
|
||||
bl_label = "Hide/Mask"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -1287,6 +1287,23 @@ class VIEW3D_MT_hide(Menu):
|
||||
op.action = 'SHOW'
|
||||
op.area = 'INSIDE'
|
||||
|
||||
op = layout.operator("paint.hide_show", text="Hide Masked")
|
||||
op.area = 'MASKED'
|
||||
op.action = 'HIDE'
|
||||
|
||||
layout.separator()
|
||||
|
||||
op = layout.operator("paint.mask_flood_fill", text="Invert Mask")
|
||||
op.mode = 'INVERT'
|
||||
|
||||
op = layout.operator("paint.mask_flood_fill", text="Fill Mask")
|
||||
op.mode = 'VALUE'
|
||||
op.value = 1
|
||||
|
||||
op = layout.operator("paint.mask_flood_fill", text="Clear Mask")
|
||||
op.mode = 'VALUE'
|
||||
op.value = 0
|
||||
|
||||
|
||||
# ********** Particle menu **********
|
||||
|
||||
|
@ -634,6 +634,15 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
|
||||
for (i = 0; i <= 5; i++)
|
||||
RNA_int_set(WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY + i, KM_PRESS, KM_CTRL, 0)->ptr, "level", i);
|
||||
|
||||
/* Clear mask */
|
||||
kmi= WM_keymap_add_item(keymap, "PAINT_OT_mask_flood_fill", MKEY, KM_PRESS, KM_ALT, 0);
|
||||
RNA_enum_set(kmi->ptr, "mode", PAINT_MASK_FLOOD_VALUE);
|
||||
RNA_float_set(kmi->ptr, "value", 0);
|
||||
|
||||
/* Invert mask */
|
||||
kmi= WM_keymap_add_item(keymap, "PAINT_OT_mask_flood_fill", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_enum_set(kmi->ptr, "mode", PAINT_MASK_INVERT);
|
||||
|
||||
/* multires switch */
|
||||
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0);
|
||||
RNA_int_set(kmi->ptr, "level", 1);
|
||||
|
Loading…
Reference in New Issue
Block a user