diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-10-16 14:28:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-10-16 14:28:24 +0300 |
commit | a2758152e2dccb3b016e13a3de2d9e58587866ab (patch) | |
tree | d872a7ae82e682012758c12eb5d8c8e63828c00d /source/blender/editors/gpencil | |
parent | 14af3e485f1207e8f4ddb6991b22e1ba2f937c45 (diff) | |
parent | 870b4b673511094cf0beaeaf07305407ccdda47a (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_select.c | 24 |
3 files changed, 15 insertions, 19 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 1cee8db792a..38927cf91e1 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1851,8 +1851,6 @@ static int gpsculpt_brush_modal(bContext *C, wmOperator *op, const wmEvent *even void GPENCIL_OT_brush_paint(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name = "Stroke Sculpt"; ot->idname = "GPENCIL_OT_brush_paint"; @@ -1869,7 +1867,9 @@ void GPENCIL_OT_brush_paint(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* properties */ - RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); + PropertyRNA *prop; + prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); 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"); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index e0751985bcd..fcca0a38c3f 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2784,8 +2784,10 @@ void GPENCIL_OT_draw(wmOperatorType *ot) ot->flag = OPTYPE_UNDO | OPTYPE_BLOCKING; /* settings for drawing */ + PropertyRNA *prop; ot->prop = RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to interpret mouse movements"); - RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); + prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); /* NOTE: wait for input is enabled by default, so that all UI code can work properly without needing users to know about this */ RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately"); diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 2912a1ac4eb..3d9689ab54f 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -769,8 +769,7 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op) const int my = RNA_int_get(op->ptr, "y"); const int radius = RNA_int_get(op->ptr, "radius"); - const int gesture_mode = RNA_int_get(op->ptr, "gesture_mode"); - const bool select = (gesture_mode == GESTURE_MODAL_SELECT); + bool select = !RNA_boolean_get(op->ptr, "deselect"); GP_SpaceConversion gsc = {NULL}; rcti rect = {0}; /* for bounding rect around circle (for quicky intersection testing) */ @@ -830,10 +829,7 @@ void GPENCIL_OT_select_circle(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* properties */ - RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "radius", 1, 1, INT_MAX, "Radius", "", 1, INT_MAX); - RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_circle_select(ot); } /* ********************************************** */ @@ -843,8 +839,7 @@ static int gpencil_border_select_exec(bContext *C, wmOperator *op) { ScrArea *sa = CTX_wm_area(C); - const int gesture_mode = RNA_int_get(op->ptr, "gesture_mode"); - const bool select = (gesture_mode == GESTURE_MODAL_SELECT); + const bool select = !RNA_boolean_get(op->ptr, "deselect"); const bool extend = RNA_boolean_get(op->ptr, "extend"); GP_SpaceConversion gsc = {NULL}; @@ -936,10 +931,10 @@ void GPENCIL_OT_select_border(wmOperatorType *ot) ot->idname = "GPENCIL_OT_select_border"; /* callbacks */ - ot->invoke = WM_border_select_invoke; + ot->invoke = WM_gesture_border_invoke; ot->exec = gpencil_border_select_exec; - ot->modal = WM_border_select_modal; - ot->cancel = WM_border_select_cancel; + ot->modal = WM_gesture_border_modal; + ot->cancel = WM_gesture_border_cancel; ot->poll = gpencil_select_poll; @@ -947,7 +942,7 @@ void GPENCIL_OT_select_border(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* rna */ - WM_operator_properties_gesture_border(ot, true); + WM_operator_properties_gesture_border_select(ot); } /* ********************************************** */ @@ -1056,9 +1051,8 @@ void GPENCIL_OT_select_lasso(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_UNDO; - RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", ""); - RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "Deselect rather than select items"); - RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first"); + /* properties */ + WM_operator_properties_gesture_lasso_select(ot); } /* ********************************************** */ |