diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-03 16:44:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-03 17:28:59 +0300 |
commit | 48d7cf680ebe8ea7c09ef3e0e4abd1dc93d3fa5f (patch) | |
tree | 1ac4900663508c2d735d794768bca842c7d1ac59 /source/blender/editors/space_action/action_select.c | |
parent | 69e512243c781129a7eca853a7a0c2c2d58dd709 (diff) |
Keymap: Select/De-Select support for anim-editors
Also update menu items, adding select/de-select.
Diffstat (limited to 'source/blender/editors/space_action/action_select.c')
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 11145e29627..b6431596323 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 **************************** */ |