[Bf-blender-cvs] [c261052] master: Fix T34993: "Jump to Next Keyframe" shortcut not related to the timeline viewable keyframes

Joshua Leung noreply at git.blender.org
Sun Apr 27 12:10:58 CEST 2014


Commit: c26105278fd770241763e04645dfcf5097e1c5d4
Author: Joshua Leung
Date:   Sat Apr 26 03:36:34 2014 +1200
https://developer.blender.org/rBc26105278fd770241763e04645dfcf5097e1c5d4

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?

===================================================================

M	release/scripts/startup/bl_ui/space_time.py
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_time/space_time.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py
index c0d5553..691a6cd 100644
--- a/release/scripts/startup/bl_ui/space_time.py
+++ b/release/scripts/startup/bl_ui/space_time.py
@@ -122,6 +122,7 @@ class TIME_MT_view(Menu):
     def draw(self, context):
         layout = self.layout
 
+        scene = context.scene
         st = context.space_data
 
         layout.prop(st, "show_seconds")
@@ -130,7 +131,7 @@ class TIME_MT_view(Menu):
         layout.separator()
 
         layout.prop(st, "show_frame_indicator")
-        layout.prop(st, "show_only_selected")
+        layout.prop(scene, "show_keys_from_selected_only")
 
         layout.separator()
 
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 666ba00..49a3d84 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 51d9840..04c1225 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,
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index e36ce7d..2e6ef7a 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1245,6 +1245,8 @@ typedef struct Scene {
 	/* use preview range */
 #define SCER_PRV_RANGE	(1<<0)
 #define SCER_LOCK_FRAME_SELECTION	(1<<1)
+	/* timeline/keyframe jumping - only selected items (on by default) */
+#define SCE_KEYS_NO_SELONLY	(1<<2)
 
 /* mode (int now) */
 #define R_OSA			0x0001
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 5df4b03..7ea719c 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5247,6 +5247,14 @@ void RNA_def_scene(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Preview Range End Frame", "Alternative end frame for UI playback");
 	RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL);
 	
+	/* Timeline / Time Navigation settings */
+	prop = RNA_def_property(srna, "show_keys_from_selected_only", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SCE_KEYS_NO_SELONLY);
+	RNA_def_property_ui_text(prop, "Only Keyframes from Selected Channels",
+	                         "Consider keyframes for active Object and/or its selected bones only "
+	                         "(in timeline and when jumping between keyframes)");
+	RNA_def_property_update(prop, NC_SCENE | ND_FRAME, NULL);
+	
 	/* Stamp */
 	prop = RNA_def_property(srna, "use_stamp_note", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "r.stamp_udata");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index fb45718..85d0344 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2941,12 +2941,6 @@ static void rna_def_space_time(BlenderRNA *brna)
 	RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
 	
 	/* view settings */
-	prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
-	RNA_def_property_ui_text(prop, "Only Selected Channels",
-	                         "Show keyframes for active Object and/or its selected bones only");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, NULL);
-	
 	prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_CFRA_NUM);
 	RNA_def_property_ui_text(prop, "Show Frame Number Indicator",




More information about the Bf-blender-cvs mailing list