Sculpt: Line gestures and Mask Line tool
This adds support for line gesture to SculptGestureContext and implements a Mask Line tool, which affects everything to the right of a plane defined by the straightline gesture. For this to work, a new WM_gesture_straightline_oneshot_modal is needed which only runs exec when the gesture is over. Added as experimental as it does not have icon. Reviewed By: Severin Differential Revision: https://developer.blender.org/D8722
This commit is contained in:

committed by
Pablo Dobarro

parent
4c74980e7b
commit
8c81b3fb8b
@@ -1258,6 +1258,21 @@ class _defs_sculpt:
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
def mask_line():
|
||||
def draw_settings(_context, layout, tool):
|
||||
props = tool.operator_properties("paint.mask_line_gesture")
|
||||
layout.prop(props, "use_front_faces_only", expand=False)
|
||||
|
||||
return dict(
|
||||
idname="builtin.line_mask",
|
||||
label="Line Mask",
|
||||
icon="ops.sculpt.line_mask",
|
||||
widget=None,
|
||||
keymap=(),
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
|
||||
@ToolDef.from_fn
|
||||
def face_set_box():
|
||||
def draw_settings(_context, layout, tool):
|
||||
@@ -1273,6 +1288,7 @@ class _defs_sculpt:
|
||||
draw_settings=draw_settings,
|
||||
)
|
||||
|
||||
|
||||
@ToolDef.from_fn
|
||||
def face_set_lasso():
|
||||
def draw_settings(_context, layout, tool):
|
||||
@@ -1308,7 +1324,6 @@ class _defs_sculpt:
|
||||
keymap=(),
|
||||
)
|
||||
|
||||
|
||||
@ToolDef.from_fn
|
||||
def mesh_filter():
|
||||
def draw_settings(_context, layout, tool):
|
||||
@@ -2652,6 +2667,13 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
|
||||
_defs_sculpt.mask_lasso,
|
||||
),
|
||||
_defs_sculpt.hide_border,
|
||||
lambda context: (
|
||||
(_defs_sculpt.mask_line,)
|
||||
if context is None or (
|
||||
context.preferences.view.show_developer_ui and
|
||||
context.preferences.experimental.use_tools_missing_icons)
|
||||
else ()
|
||||
),
|
||||
lambda context: (
|
||||
(_defs_sculpt.face_set_box,)
|
||||
if context is None or (
|
||||
|
Reference in New Issue
Block a user