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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-07-25 23:45:34 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-07-25 23:45:34 +0400
commit4ca9275b448fa62fa1c0d55007417558c6552d77 (patch)
treeb1d639721eca0ad58464be6fb6cd085ab6089a0b /source/blender/editors/space_outliner/outliner_tools.c
parentb66f541b426be7a5904459625627ad354c796ed2 (diff)
Implement operator to select linked data from outliner
Supports selecting using object data, material and library. Would be nice to hide this menu item from menus appearing for datablocks which does not support such a selection, but that could be done separately.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tools.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 3d01de1c67a..acfaadb947d 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -324,6 +324,14 @@ static void id_fake_user_clear_cb(bContext *UNUSED(C), Scene *UNUSED(scene), Tre
}
}
+static void id_select_linked_cb(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te),
+ TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
+{
+ ID *id = tselem->id;
+
+ ED_object_select_linked_by_id(C, id);
+}
+
static void singleuser_action_cb(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te),
TreeStoreElem *tsep, TreeStoreElem *tselem)
{
@@ -728,7 +736,9 @@ typedef enum eOutlinerIdOpTypes {
OUTLINER_IDOP_FAKE_ADD,
OUTLINER_IDOP_FAKE_CLEAR,
- OUTLINER_IDOP_RENAME
+ OUTLINER_IDOP_RENAME,
+
+ OUTLINER_IDOP_SELECT_LINKED
} eOutlinerIdOpTypes;
// TODO: implement support for changing the ID-block used
@@ -740,6 +750,7 @@ static EnumPropertyItem prop_id_op_types[] = {
"Ensure datablock gets saved even if it isn't in use (e.g. for motion and material libraries)"},
{OUTLINER_IDOP_FAKE_CLEAR, "CLEAR_FAKE", 0, "Clear Fake User", ""},
{OUTLINER_IDOP_RENAME, "RENAME", 0, "Rename", ""},
+ {OUTLINER_IDOP_SELECT_LINKED, "SELECT_LINKED", 0, "Select Linked", ""},
{0, NULL, 0, NULL, NULL}
};
@@ -855,6 +866,11 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op)
ED_undo_push(C, "Rename");
}
break;
+
+ case OUTLINER_IDOP_SELECT_LINKED:
+ outliner_do_libdata_operation(C, scene, soops, &soops->tree, id_select_linked_cb);
+ ED_undo_push(C, "Select");
+ break;
default:
// invalid - unhandled