diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-01 11:10:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-01 13:32:38 +0300 |
commit | 928becec60d16880838dd756cc8b6b5ee73f9b2d (patch) | |
tree | a54a8038c357c20d7b88a52d065b0f487480597d /source/blender/editors/sculpt_paint/paint_ops.c | |
parent | 5fd69f6bd8c91b73135d22b3cad829b0892dabca (diff) |
UV Sculpt: improve tool-system integration
In 2.7x UV sculpt was a kind of sub-mode
(a toggle with it's own key-map & drawing code).
Move this to an operator that uses the tool-system,
this simplifies internal logic, especially brush selection
which now matches sculpt and other paint modes.
- Remove toggle used to enable uv sculpt.
- Expose the brush, which was already used but there was no way to
select different brushes.
- Make UV sculpt use paint paint tool slots
(using brushes how all other paint mode currently do).
- Move UV Sculpt keymap to the tools keymap.
- Remove Q to toggle UV sculpt mode,
S/P/G keys to switch tools.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index a85a256c15f..f58afcdadc1 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -524,37 +524,6 @@ static void PAINT_OT_brush_select(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } -static int brush_uv_sculpt_tool_set_exec(bContext *C, wmOperator *op) -{ - Brush *brush; - Scene *scene = CTX_data_scene(C); - ToolSettings *ts = scene->toolsettings; - ts->uv_sculpt_tool = RNA_enum_get(op->ptr, "tool"); - brush = ts->uvsculpt->paint.brush; - /* To update toolshelf */ - WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush); - - return OPERATOR_FINISHED; -} - -static void BRUSH_OT_uv_sculpt_tool_set(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "UV Sculpt Tool Set"; - ot->description = "Set the UV sculpt tool"; - ot->idname = "BRUSH_OT_uv_sculpt_tool_set"; - - /* api callbacks */ - ot->exec = brush_uv_sculpt_tool_set_exec; - ot->poll = uv_sculpt_poll; - - /* flags */ - ot->flag = 0; - - /* props */ - ot->prop = RNA_def_enum(ot->srna, "tool", rna_enum_uv_sculpt_tool_items, 0, "Tool", ""); -} - /***** Stencil Control *****/ typedef enum { @@ -1014,7 +983,6 @@ void ED_operatortypes_paint(void) /* note, particle uses a different system, can be added with existing operators in wm.py */ WM_operatortype_append(PAINT_OT_brush_select); - WM_operatortype_append(BRUSH_OT_uv_sculpt_tool_set); /* image */ WM_operatortype_append(PAINT_OT_texture_paint_toggle); @@ -1101,9 +1069,6 @@ void ED_keymap_paint(wmKeyConfig *keyconf) keymap = WM_keymap_ensure(keyconf, "Face Mask", 0, 0); keymap->poll = facemask_paint_poll; - keymap = WM_keymap_ensure(keyconf, "UV Sculpt", 0, 0); - keymap->poll = uv_sculpt_keymap_poll; - /* paint stroke */ keymap = paint_stroke_modal_keymap(keyconf); WM_modalkeymap_assign(keymap, "SCULPT_OT_brush_stroke"); |