From 06a9482986daa8beea1bbb627e2b78b4c28bd3d2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 25 Jul 2012 20:17:38 +0000 Subject: Select Linked no works from Datablocks outliner view as well --- source/blender/editors/space_outliner/outliner_tools.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index acfaadb947d..bf76fdda61e 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -530,6 +530,18 @@ static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem, void (void)tselem; } +static void data_select_linked_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem), void *C_v) +{ + if (event == 5) { + if (RNA_struct_is_ID(te->rnaptr.type)) { + bContext *C = (bContext *) C_v; + ID *id = te->rnaptr.data; + + ED_object_select_linked_by_id(C, id); + } + } +} + static void outliner_do_data_operation(SpaceOops *soops, int type, int event, ListBase *lb, void (*operation_cb)(int, TreeElement *, TreeStoreElem *, void *), void *arg) @@ -1131,6 +1143,7 @@ static EnumPropertyItem prop_data_op_types[] = { {2, "DESELECT", 0, "Deselect", ""}, {3, "HIDE", 0, "Hide", ""}, {4, "UNHIDE", 0, "Unhide", ""}, + {5, "SELECT_LINKED", 0, "Select Linked", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1174,6 +1187,11 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op) outliner_do_data_operation(soops, datalevel, event, &soops->tree, sequence_cb, scene); } } + else if (datalevel == TSE_RNA_STRUCT) { + if (event == 5) { + outliner_do_data_operation(soops, datalevel, event, &soops->tree, data_select_linked_cb, C); + } + } return OPERATOR_FINISHED; } -- cgit v1.2.3