diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-13 08:52:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-13 08:52:39 +0300 |
commit | b657e9875cefa3b5e05964f023ad843fe7e24ebb (patch) | |
tree | d10353e3fc32a186d4bb143385fdf3f1efd2b414 /source/blender/editors/gpencil/gpencil_brush.c | |
parent | 3437cd9ac22e0a5ae611454ae6f36f24697774c8 (diff) |
Tool System: use enum for gp sculpt/weight paint
Fixes T57525
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_brush.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 8e2cc8fd143..5c1b029fe95 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1188,18 +1188,10 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op) const bool is_weight_mode = ob->mode == OB_MODE_GPENCIL_WEIGHT; /* set the brush using the tool */ +#if 0 GP_BrushEdit_Settings *gset = &ts->gp_sculpt; - eGP_EditBrush_Types mode = RNA_enum_get(op->ptr, "mode"); - const bool keep_brush = RNA_boolean_get(op->ptr, "keep_brush"); - - if (!keep_brush) { - if (is_weight_mode) { - gset->weighttype = mode; - } - else { - gset->brushtype = mode; - } - } + eGP_EditBrush_Types mode = is_weight_mode ? gset->weighttype : gset->brushtype; +#endif tGP_BrushEditData *gso; /* setup operator data */ @@ -2099,22 +2091,6 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even return OPERATOR_RUNNING_MODAL; } - -/* Operator --------------------------------------------- */ -static const EnumPropertyItem prop_gpencil_sculpt_brush_items[] = { - {GP_EDITBRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke points" }, - {GP_EDITBRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust thickness of strokes" }, - {GP_EDITBRUSH_TYPE_STRENGTH, "STRENGTH", 0, "Strength", "Adjust color strength of strokes" }, - {GP_EDITBRUSH_TYPE_GRAB, "GRAB", 0, "Grab", "Translate the set of points initially within the brush circle" }, - {GP_EDITBRUSH_TYPE_PUSH, "PUSH", 0, "Push", "Move points out of the way, as if combing them" }, - {GP_EDITBRUSH_TYPE_TWIST, "TWIST", 0, "Twist", "Rotate points around the midpoint of the brush" }, - {GP_EDITBRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", "Pull points towards the midpoint of the brush" }, - {GP_EDITBRUSH_TYPE_RANDOMIZE, "RANDOMIZE", 0, "Randomize", "Introduce jitter/randomness into strokes" }, - {GP_EDITBRUSH_TYPE_CLONE, "CLONE", 0, "Clone", "Paste copies of the strokes stored on the clipboard" }, - {GP_EDITBRUSH_TYPE_WEIGHT, "WEIGHT", 0, "Weight", "Weight Paint" }, - {0, NULL, 0, NULL, NULL } -}; - void GPENCIL_OT_brush_paint(wmOperatorType *ot) { /* identifiers */ @@ -2133,9 +2109,6 @@ void GPENCIL_OT_brush_paint(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* properties */ - ot->prop = RNA_def_enum(ot->srna, "mode", prop_gpencil_sculpt_brush_items, 0, "Mode", "Brush mode"); - RNA_def_property_flag(ot->prop, PROP_HIDDEN | PROP_SKIP_SAVE); - PropertyRNA *prop; prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); @@ -2143,10 +2116,4 @@ void GPENCIL_OT_brush_paint(wmOperatorType *ot) prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Enter a mini 'sculpt-mode' if enabled, otherwise, exit after drawing a single stroke"); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - - prop = RNA_def_boolean(ot->srna, "keep_brush", false, "Keep Brush", - "Keep current brush activated"); - RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } - -/* ************************************************ */ |