Select Linked no works from Datablocks outliner view as well

This commit is contained in:
Sergey Sharybin 2012-07-25 20:17:38 +00:00
parent 4ca9275b44
commit 06a9482986

@ -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;
}