[Bf-blender-cvs] [7b8e1279029] greasepencil-object: Reuse show_keys_from_selected_only for jump frames

Antonio Vazquez noreply at git.blender.org
Tue Nov 28 14:11:18 CET 2017


Commit: 7b8e1279029b976ae6d1c693c5c7eb3a082b5cb5
Author: Antonio Vazquez
Date:   Tue Nov 28 14:11:11 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB7b8e1279029b976ae6d1c693c5c7eb3a082b5cb5

Reuse show_keys_from_selected_only for jump frames

It's better to reuse this option that is already defined by scene.

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

M	release/scripts/startup/bl_ui/space_dopesheet.py
M	source/blender/editors/screen/screen_ops.c
M	source/blender/makesdna/DNA_action_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 8301cbd6dd1..08136581531 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -116,6 +116,7 @@ class DOPESHEET_HT_header(Header):
         layout = self.layout
 
         st = context.space_data
+        scene = context.scene
         toolsettings = context.tool_settings
 
         row = layout.row(align=True)
@@ -146,7 +147,7 @@ class DOPESHEET_HT_header(Header):
             dopesheet_filter(layout, context, genericFiltersOnly=True)
         elif st.mode == 'GPENCIL':
             row = layout.row(align=True)
-            row.prop(st, "use_gp_jump_active", text="", icon="RESTRICT_SELECT_OFF")
+            row.prop(scene, "show_keys_from_selected_only", text="", icon="RESTRICT_SELECT_OFF")
             row.prop(st.dopesheet, "show_gpencil_3d_only", text="Active Only")
 
             if st.dopesheet.show_gpencil_3d_only:
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index d217f24a720..956a7708152 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2237,7 +2237,6 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
 	Main *bmain = CTX_data_main(C);
 	Scene *scene = CTX_data_scene(C);
 	Object *ob = CTX_data_active_object(C);
-	SpaceAction *spa = (SpaceAction *)CTX_wm_space_data(C);
 	bDopeSheet ads = {NULL};
 	DLRBT_Tree keys;
 	ActKeyColumn *ak;
@@ -2275,8 +2274,8 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
 	if (ob) {
 		ob_to_keylist(&ads, ob, &keys, NULL);
 		
-		if ((ob->type == OB_GPENCIL) && (spa) && (spa->mode == SACTCONT_GPENCIL)) {
-			const bool active = (spa->flag & SACTION_GP_JUMP_ACTIVE);
+		if (ob->type == OB_GPENCIL) {
+			const bool active = !(scene->flag & SCE_KEYS_NO_SELONLY);
 			gpencil_to_keylist(&ads, ob->data, &keys, active);
 		}
 	}
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 1f443d2850f..a5b22e7fee2 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -706,9 +706,7 @@ typedef enum eSAction_Flag {
 	/* don't perform realtime updates */
 	SACTION_NOREALTIMEUPDATES = (1 << 10),
 	/* move markers as well as keyframes */
-	SACTION_MARKERS_MOVE = (1 << 11),
-	/* jump gpencil active layer */
-	SACTION_GP_JUMP_ACTIVE = (1 << 12)
+	SACTION_MARKERS_MOVE = (1 << 11)
 } eSAction_Flag;
 
 /* SpaceAction Mode Settings */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 3edf0a125c9..3a496d13429 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3292,11 +3292,6 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
 	RNA_def_property_pointer_sdna(prop, NULL, "ads");
 	RNA_def_property_ui_text(prop, "Dope Sheet", "Settings for filtering animation data");
 
-	prop = RNA_def_property(srna, "use_gp_jump_active", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_GP_JUMP_ACTIVE);
-	RNA_def_property_ui_text(prop, "Jump Active",
-		"Only jump between keyframes in the current Grease Pencil active layer");
-
 	/* autosnap */
 	prop = RNA_def_property(srna, "auto_snap", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "autosnap");



More information about the Bf-blender-cvs mailing list