diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-30 09:16:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-30 09:16:44 +0300 |
commit | f4379f8b914eaf7aa1f17323f927836a3d9288fc (patch) | |
tree | f0fa1827cdbfd63b18ee6c4306d4ff6b57fcbf51 /source/blender/editors/animation | |
parent | 9c960557a7d2734b3be8cf5f512ef0d8bba54e98 (diff) |
Use Ctrl Snap to seconds w/ play-head drag
D3056 by @alourenco
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 8612f5944bb..939d547dc94 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -45,6 +45,7 @@ #include "BKE_global.h" #include "BKE_main.h" #include "BKE_sound.h" +#include "BKE_scene.h" #include "UI_view2d.h" @@ -98,8 +99,13 @@ static void change_frame_apply(bContext *C, wmOperator *op) float frame = RNA_float_get(op->ptr, "frame"); bool do_snap = RNA_boolean_get(op->ptr, "snap"); - if (do_snap && CTX_wm_space_seq(C)) { - frame = BKE_sequencer_find_next_prev_edit(scene, frame, SEQ_SIDE_BOTH, true, false, false); + if (do_snap) { + if (CTX_wm_space_seq(C)) { + frame = BKE_sequencer_find_next_prev_edit(scene, frame, SEQ_SIDE_BOTH, true, false, false); + } + else { + frame = BKE_scene_frame_snap_by_seconds(scene, 1.0, frame); + } } /* set the new frame number */ |