diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-09-21 16:13:43 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-09-21 18:06:52 +0300 |
commit | e8d953000afb462ee05140c9c4ec18bf60140687 (patch) | |
tree | 01e3a19f9f0f1be0fcdc8673d15abc107791a0b9 /source/blender/editors/animation | |
parent | a7e74791221e2ef9b44ee1b3eb9ece37785aa62a (diff) |
UI: Configurable shortcuts for keyframe operators
Adds support for editing the shortcuts for inserting (I), deleting (Alt+I) and clearing (Alt+Shift+I) button keyframes.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 98be77b491f..f2a35bb1553 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1771,8 +1771,10 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) flag = ANIM_get_keyframing_flags(scene, 1); /* try to insert keyframe using property retrieved from UI */ - but = UI_context_active_but_get(C); - UI_context_active_but_prop_get(C, &ptr, &prop, &index); + if (!(but = UI_context_active_but_prop_get(C, &ptr, &prop, &index))) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } if ((ptr.id.data && ptr.data && prop) && RNA_property_animateable(&ptr, prop)) { if (ptr.type == &RNA_NlaStrip) { @@ -1873,7 +1875,10 @@ static int delete_key_button_exec(bContext *C, wmOperator *op) const bool all = RNA_boolean_get(op->ptr, "all"); /* try to insert keyframe using property retrieved from UI */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); + if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } if (ptr.id.data && ptr.data && prop) { if (ptr.type == &RNA_NlaStrip) { @@ -1973,7 +1978,10 @@ static int clear_key_button_exec(bContext *C, wmOperator *op) const bool all = RNA_boolean_get(op->ptr, "all"); /* try to insert keyframe using property retrieved from UI */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); + if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { + /* pass event on if no active button found */ + return (OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH); + } if (ptr.id.data && ptr.data && prop) { path = RNA_path_from_ID_to_property(&ptr, prop); |