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:
Diffstat (limited to 'source/blender/editors/space_action/action_select.c')
-rw-r--r--source/blender/editors/space_action/action_select.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 11145e29627..c46d0fdb035 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -157,10 +157,24 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
/* 'standard' behavior - check if selected, then apply relevant selection */
- if (RNA_boolean_get(op->ptr, "invert"))
- deselect_action_keys(&ac, 0, SELECT_INVERT);
- else
- deselect_action_keys(&ac, 1, SELECT_ADD);
+ const int action = RNA_enum_get(op->ptr, "action");
+ switch (action) {
+ case SEL_TOGGLE:
+ deselect_action_keys(&ac, 1, SELECT_ADD);
+ break;
+ case SEL_SELECT:
+ deselect_action_keys(&ac, 0, SELECT_ADD);
+ break;
+ case SEL_DESELECT:
+ deselect_action_keys(&ac, 0, SELECT_SUBTRACT);
+ break;
+ case SEL_INVERT:
+ deselect_action_keys(&ac, 0, SELECT_INVERT);
+ break;
+ default:
+ BLI_assert(0);
+ break;
+ }
/* set notifier that keyframe selection have changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
@@ -168,11 +182,11 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ACTION_OT_select_all_toggle(wmOperatorType *ot)
+void ACTION_OT_select_all(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select All";
- ot->idname = "ACTION_OT_select_all_toggle";
+ ot->idname = "ACTION_OT_select_all";
ot->description = "Toggle selection of all keyframes";
/* api callbacks */
@@ -182,9 +196,8 @@ void ACTION_OT_select_all_toggle(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- /* props */
- ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
- RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
+ /* properties */
+ WM_operator_properties_select_all(ot);
}
/* ******************** Border Select Operator **************************** */
@@ -1356,7 +1369,7 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_
rctf rectf;
/* get dopesheet info */
- if (ac->datatype == ANIMCONT_DOPESHEET)
+ if (ELEM(ac->datatype, ANIMCONT_DOPESHEET, ANIMCONT_TIMELINE))
ads = ac->data;
/* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */
@@ -1477,7 +1490,7 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_
deselect_action_keys(ac, 0, SELECT_SUBTRACT);
/* highlight channel clicked on */
- if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) {
+ if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_TIMELINE)) {
/* deselect all other channels first */
ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);