Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/ui/space_dopesheet.py3
-rw-r--r--release/scripts/ui/space_graph.py3
-rw-r--r--source/blender/editors/space_action/action_intern.h1
-rw-r--r--source/blender/editors/space_action/action_ops.c3
-rw-r--r--source/blender/editors/space_action/action_select.c55
-rw-r--r--source/blender/editors/space_graph/graph_intern.h2
-rw-r--r--source/blender/editors/space_graph/graph_ops.c4
-rw-r--r--source/blender/editors/space_graph/graph_select.c55
8 files changed, 126 insertions, 0 deletions
diff --git a/release/scripts/ui/space_dopesheet.py b/release/scripts/ui/space_dopesheet.py
index e8e2466f049..41917acd997 100644
--- a/release/scripts/ui/space_dopesheet.py
+++ b/release/scripts/ui/space_dopesheet.py
@@ -124,6 +124,9 @@ class DOPESHEET_MT_select(bpy.types.Menu):
layout.operator("action.select_more")
layout.operator("action.select_less")
+ layout.separator()
+ layout.operator("action.select_linked")
+
class DOPESHEET_MT_channel(bpy.types.Menu):
bl_label = "Channel"
diff --git a/release/scripts/ui/space_graph.py b/release/scripts/ui/space_graph.py
index 0106833ce0d..b2a430eb7cd 100644
--- a/release/scripts/ui/space_graph.py
+++ b/release/scripts/ui/space_graph.py
@@ -126,6 +126,9 @@ class GRAPH_MT_select(bpy.types.Menu):
layout.separator()
layout.operator("graph.select_more")
layout.operator("graph.select_less")
+
+ layout.separator()
+ layout.operator("graph.select_linked")
class GRAPH_MT_channel(bpy.types.Menu):
diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h
index ecbde7f4a21..b02e95ac138 100644
--- a/source/blender/editors/space_action/action_intern.h
+++ b/source/blender/editors/space_action/action_intern.h
@@ -56,6 +56,7 @@ void action_header_buttons(const struct bContext *C, struct ARegion *ar);
void ACTION_OT_select_all_toggle(struct wmOperatorType *ot);
void ACTION_OT_select_border(struct wmOperatorType *ot);
void ACTION_OT_select_column(struct wmOperatorType *ot);
+void ACTION_OT_select_linked(struct wmOperatorType *ot);
void ACTION_OT_select_more(struct wmOperatorType *ot);
void ACTION_OT_select_less(struct wmOperatorType *ot);
void ACTION_OT_clickselect(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c
index f65bd67dcf8..8500087c00d 100644
--- a/source/blender/editors/space_action/action_ops.c
+++ b/source/blender/editors/space_action/action_ops.c
@@ -119,6 +119,9 @@ static void action_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
WM_keymap_add_item(keymap, "ACTION_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "ACTION_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
+ /* select linekd */
+ WM_keymap_add_item(keymap, "ACTION_OT_select_linked", LKEY, KM_PRESS, 0, 0);
+
/* action_edit.c */
/* snap - current frame to selected keys */
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 877b40c5cb1..8f1d2d4be0e 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -558,6 +558,61 @@ void ACTION_OT_select_column (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
}
+/* ******************** Select Linked Operator *********************** */
+
+static int actkeys_select_linked_exec (bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+
+ ListBase anim_data= {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ KeyframeEditFunc ok_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
+ KeyframeEditFunc sel_cb = ANIM_editkeyframes_select(SELECT_ADD);
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* loop through all of the keys and select additional keyframes based on these */
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ FCurve *fcu= (FCurve *)ale->key_data;
+
+ /* check if anything selected? */
+ if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, ok_cb, NULL)) {
+ /* select every keyframe in this curve then */
+ ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL);
+ }
+ }
+
+ /* Cleanup */
+ BLI_freelistN(&anim_data);
+
+ /* set notifier that keyframe selection has changed */
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void ACTION_OT_select_linked (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Select Linked";
+ ot->idname= "ACTION_OT_select_linked";
+ ot->description = "Select keyframes occurring the same F-Curves as selected ones";
+
+ /* api callbacks */
+ ot->exec= actkeys_select_linked_exec;
+ ot->poll= ED_operator_action_active;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+}
+
/* ******************** Select More/Less Operators *********************** */
/* Common code to perform selection */
diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h
index a875558d6ef..a637ed15fcd 100644
--- a/source/blender/editors/space_graph/graph_intern.h
+++ b/source/blender/editors/space_graph/graph_intern.h
@@ -63,6 +63,7 @@ void graph_header_buttons(const bContext *C, struct ARegion *ar);
void GRAPH_OT_select_all_toggle(struct wmOperatorType *ot);
void GRAPH_OT_select_border(struct wmOperatorType *ot);
void GRAPH_OT_select_column(struct wmOperatorType *ot);
+void GRAPH_OT_select_linked(struct wmOperatorType *ot);
void GRAPH_OT_select_more(struct wmOperatorType *ot);
void GRAPH_OT_select_less(struct wmOperatorType *ot);
void GRAPH_OT_clickselect(struct wmOperatorType *ot);
@@ -149,6 +150,7 @@ void GRAPH_OT_ghost_curves_clear(struct wmOperatorType *ot);
/* ***************************************** */
/* graph_buttons.c */
+
void GRAPH_OT_properties(struct wmOperatorType *ot);
void graph_buttons_register(struct ARegionType *art);
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 07a9034e526..d3d2743200b 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -231,6 +231,7 @@ void graphedit_operatortypes(void)
WM_operatortype_append(GRAPH_OT_select_all_toggle);
WM_operatortype_append(GRAPH_OT_select_border);
WM_operatortype_append(GRAPH_OT_select_column);
+ WM_operatortype_append(GRAPH_OT_select_linked);
WM_operatortype_append(GRAPH_OT_select_more);
WM_operatortype_append(GRAPH_OT_select_less);
@@ -318,6 +319,9 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
WM_keymap_add_item(keymap, "GRAPH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "GRAPH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
+ /* select linked */
+ WM_keymap_add_item(keymap, "GRAPH_OT_select_linked", LKEY, KM_PRESS, 0, 0);
+
/* graph_edit.c */
/* snap - current frame to selected keys */
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index c8b31f38f59..a81de25f265 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -547,6 +547,61 @@ void GRAPH_OT_select_column (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
}
+/* ******************** Select Linked Operator *********************** */
+
+static int graphkeys_select_linked_exec (bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+
+ ListBase anim_data= {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ KeyframeEditFunc ok_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
+ KeyframeEditFunc sel_cb = ANIM_editkeyframes_select(SELECT_ADD);
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* loop through all of the keys and select additional keyframes based on these */
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ FCurve *fcu= (FCurve *)ale->key_data;
+
+ /* check if anything selected? */
+ if (ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, ok_cb, NULL)) {
+ /* select every keyframe in this curve then */
+ ANIM_fcurve_keyframes_loop(NULL, fcu, NULL, sel_cb, NULL);
+ }
+ }
+
+ /* Cleanup */
+ BLI_freelistN(&anim_data);
+
+ /* set notifier that keyframe selection has changed */
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+void GRAPH_OT_select_linked (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Select Linked";
+ ot->idname= "GRAPH_OT_select_linked";
+ ot->description = "Select keyframes occurring the same F-Curves as selected ones";
+
+ /* api callbacks */
+ ot->exec= graphkeys_select_linked_exec;
+ ot->poll= graphop_visible_keyframes_poll;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+}
+
/* ******************** Select More/Less Operators *********************** */
/* Common code to perform selection */