diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 03:38:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 03:42:30 +0300 |
commit | c19dafd2a62fe0bebe6f834017b108e77d133682 (patch) | |
tree | 812a90384c375ea82bdc34893bcdd3bd2f01154a /source/blender/editors/gpencil | |
parent | 895295a9f0cb85c7c48c395621b9c9d7e5fc78a3 (diff) |
Paint: paint.brush_select now supports gpencil
Replace grease pencil specific brush select operator.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 51 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_ops.c | 1 |
3 files changed, 0 insertions, 53 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 8c7068c0a7c..458e9d0eb41 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -1546,57 +1546,6 @@ void GPENCIL_OT_brush_presets_create(wmOperatorType *ot) } -/* ***************** Select Brush ************************ */ - -static int gp_brush_select_exec(bContext *C, wmOperator *op) -{ - ToolSettings *ts = CTX_data_tool_settings(C); - Main *bmain = CTX_data_main(C); - - /* if there's no existing container */ - if (ts == NULL) { - BKE_report(op->reports, RPT_ERROR, "Nowhere to go"); - return OPERATOR_CANCELLED; - } - - const int index = RNA_int_get(op->ptr, "index"); - - Paint *paint = &ts->gp_paint->paint; - int i = 0; - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { - if (brush->ob_mode == OB_MODE_GPENCIL_PAINT) { - if (i == index) { - BKE_paint_brush_set(paint, brush); - - /* notifiers */ - WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); - return OPERATOR_FINISHED; - } - i++; - } - } - - return OPERATOR_CANCELLED; -} - -void GPENCIL_OT_brush_select(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Select Brush"; - ot->idname = "GPENCIL_OT_brush_select"; - ot->description = "Select a Grease Pencil drawing brush"; - - /* callbacks */ - ot->exec = gp_brush_select_exec; - ot->poll = gp_active_brush_poll; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - /* properties */ - RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Index of Drawing Brush", 0, INT_MAX); -} - /* ***************** Select Sculpt Brush ************************ */ static int gp_sculpt_select_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index f7117189c32..bed4811d7bb 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -386,7 +386,6 @@ void GPENCIL_OT_stroke_separate(struct wmOperatorType *ot); void GPENCIL_OT_stroke_split(struct wmOperatorType *ot); void GPENCIL_OT_brush_presets_create(struct wmOperatorType *ot); -void GPENCIL_OT_brush_select(struct wmOperatorType *ot); void GPENCIL_OT_sculpt_select(struct wmOperatorType *ot); diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index d9a233b78d8..968233866f6 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -763,7 +763,6 @@ void ED_operatortypes_gpencil(void) WM_operatortype_append(GPENCIL_OT_stroke_split); WM_operatortype_append(GPENCIL_OT_brush_presets_create); - WM_operatortype_append(GPENCIL_OT_brush_select); WM_operatortype_append(GPENCIL_OT_sculpt_select); |