Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-10-16 14:28:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-16 14:28:24 +0300
commita2758152e2dccb3b016e13a3de2d9e58587866ab (patch)
treed872a7ae82e682012758c12eb5d8c8e63828c00d /source/blender/editors/animation
parent14af3e485f1207e8f4ddb6991b22e1ba2f937c45 (diff)
parent870b4b673511094cf0beaeaf07305407ccdda47a (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c24
-rw-r--r--source/blender/editors/animation/anim_markers.c22
-rw-r--r--source/blender/editors/animation/anim_ops.c6
3 files changed, 25 insertions, 27 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 01575bff3c2..051d9377207 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2457,8 +2457,8 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
bAnimContext ac;
rcti rect;
short selectmode = 0;
- int gesture_mode;
- bool extend;
+ const bool select = !RNA_boolean_get(op->ptr, "deselect");
+ const bool extend = RNA_boolean_get(op->ptr, "extend");
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -2466,17 +2466,17 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
/* get settings from operator */
WM_operator_properties_border_to_rcti(op, &rect);
-
- gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
- extend = RNA_boolean_get(op->ptr, "extend");
- if (!extend)
+ if (!extend) {
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, true, ACHANNEL_SETFLAG_CLEAR);
+ }
- if (gesture_mode == GESTURE_MODAL_SELECT)
+ if (select) {
selectmode = ACHANNEL_SETFLAG_ADD;
- else
+ }
+ else {
selectmode = ACHANNEL_SETFLAG_CLEAR;
+ }
/* apply borderselect animation channels */
borderselect_anim_channels(&ac, &rect, selectmode);
@@ -2495,10 +2495,10 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot)
ot->description = "Select all animation channels within the specified region";
/* api callbacks */
- ot->invoke = WM_border_select_invoke;
+ ot->invoke = WM_gesture_border_invoke;
ot->exec = animchannels_borderselect_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 = animedit_poll_channels_nla_tweakmode_off;
@@ -2506,7 +2506,7 @@ static void ANIM_OT_channels_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);
}
/* ******************* Rename Operator ***************************** */
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 8cf0e203a41..b24f48a10f9 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -1249,7 +1249,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
View2D *v2d = UI_view2d_fromcontext(C);
ListBase *markers = ED_context_get_markers(C);
TimeMarker *marker;
- int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
+ bool select = !RNA_boolean_get(op->ptr, "deselect");
bool extend = RNA_boolean_get(op->ptr, "extend");
rctf rect;
@@ -1262,13 +1262,11 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
/* XXX marker context */
for (marker = markers->first; marker; marker = marker->next) {
if (BLI_rctf_isect_x(&rect, marker->frame)) {
- switch (gesture_mode) {
- case GESTURE_MODAL_SELECT:
- marker->flag |= SELECT;
- break;
- case GESTURE_MODAL_DESELECT:
- marker->flag &= ~SELECT;
- break;
+ if (select) {
+ marker->flag |= SELECT;
+ }
+ else {
+ marker->flag &= ~SELECT;
}
}
else if (!extend) {
@@ -1284,7 +1282,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event)
{
- return ed_markers_opwrap_invoke_custom(C, op, event, WM_border_select_invoke);
+ return ed_markers_opwrap_invoke_custom(C, op, event, WM_gesture_border_invoke);
}
static void MARKER_OT_select_border(wmOperatorType *ot)
@@ -1297,8 +1295,8 @@ static void MARKER_OT_select_border(wmOperatorType *ot)
/* api callbacks */
ot->exec = ed_marker_border_select_exec;
ot->invoke = ed_marker_select_border_invoke_wrapper;
- 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 = ed_markers_poll_markers_exist;
@@ -1306,7 +1304,7 @@ static void MARKER_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);
}
/* *********************** (de)select all ***************** */
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index fcdd45d4ac3..f22c8c5b403 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -318,10 +318,10 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
ot->description = "Interactively define frame range used for playback";
/* api callbacks */
- ot->invoke = WM_border_select_invoke;
+ ot->invoke = WM_gesture_border_invoke;
ot->exec = previewrange_define_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 = ED_operator_animview_active;