From c26105278fd770241763e04645dfcf5097e1c5d4 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 26 Apr 2014 03:36:34 +1200 Subject: Fix T34993: "Jump to Next Keyframe" shortcut not related to the timeline viewable keyframes Made the timeline option to only show keyframes from selected channels/data be a per-scene setting instead of the per-timeline option it was previously. This makes it easier for animators working on rigs with multiple bones (especially during the polishing phase), since now the timeline and jump to keyframe operators use the same setting to decide which subset of keyframes they need to consider. By default, this option is enabled by default. TODO: Extend this to the keyframe status shading on the active object name in the 3D view? --- source/blender/editors/screen/screen_ops.c | 6 ++++++ source/blender/editors/space_time/space_time.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 666ba003948..49a3d84813c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2095,6 +2095,12 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) /* init binarytree-list for getting keyframes */ BLI_dlrbTree_init(&keys); + /* seed up dummy dopesheet context with flags to perform necessary filtering */ + if ((scene->flag & SCE_KEYS_NO_SELONLY) == 0) { + /* only selected channels are included */ + ads.filterflag |= ADS_FILTER_ONLYSEL; + } + /* populate tree with keyframe nodes */ scene_to_keylist(&ads, scene, &keys, NULL); diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 51d9840a079..04c1225afb6 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -341,7 +341,7 @@ static void time_draw_keyframes(const bContext *C, SpaceTime *stime, ARegion *ar Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); View2D *v2d = &ar->v2d; - short onlysel = (stime->flag & TIME_ONLYACTSEL); + bool onlysel = ((scene->flag & SCE_KEYS_NO_SELONLY) == 0); /* draw scene keyframes first * - don't try to do this when only drawing active/selected data keyframes, -- cgit v1.2.3