diff options
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 08d7d1d6780..8ea46e55b49 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -75,7 +75,7 @@ static int change_frame_poll(bContext *C) * this shouldn't show up in 3D editor (or others without 2D timeline view) via search */ if (sa) { - if (ELEM(sa->spacetype, SPACE_TIME, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { + if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { return true; } else if (sa->spacetype == SPACE_IPO) { @@ -86,7 +86,7 @@ static int change_frame_poll(bContext *C) } } - CTX_wm_operator_poll_msg_set(C, "Expected an timeline/animation area to be active"); + CTX_wm_operator_poll_msg_set(C, "Expected an animation area to be active"); return false; } @@ -279,6 +279,26 @@ static void ANIM_OT_change_frame(wmOperatorType *ot) /* ****************** Start/End Frame Operators *******************************/ +static int anim_set_end_frames_poll(bContext *C) +{ + ScrArea *sa = CTX_wm_area(C); + + /* XXX temp? prevent changes during render */ + if (G.is_rendering) return false; + + /* although it's only included in keymaps for regions using ED_KEYMAP_ANIMATION, + * this shouldn't show up in 3D editor (or others without 2D timeline view) via search + */ + if (sa) { + if (ELEM(sa->spacetype, SPACE_ACTION, SPACE_IPO, SPACE_NLA, SPACE_SEQ, SPACE_CLIP)) { + return true; + } + } + + CTX_wm_operator_poll_msg_set(C, "Expected an animation area to be active"); + return false; +} + static int anim_set_sfra_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene = CTX_data_scene(C); @@ -316,7 +336,7 @@ static void ANIM_OT_start_frame_set(wmOperatorType *ot) /* api callbacks */ ot->exec = anim_set_sfra_exec; - ot->poll = ED_operator_timeline_active; + ot->poll = anim_set_end_frames_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; @@ -360,7 +380,7 @@ static void ANIM_OT_end_frame_set(wmOperatorType *ot) /* api callbacks */ ot->exec = anim_set_efra_exec; - ot->poll = ED_operator_timeline_active; + ot->poll = anim_set_end_frames_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |