diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-02-01 20:53:54 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-02-02 17:25:05 +0300 |
commit | a4d2b102f313b8d427e6ff6066f38cc3a2394628 (patch) | |
tree | 6af63f78564ab08127b134394b7cc9bb29e30bed /source/blender/editors/space_outliner/outliner_tools.c | |
parent | 26dff781b3c13ad21010d595d38baa5b8b6e06a5 (diff) |
Collections: Operator to select collection objects
This is only supported by layer collections (the ones accessible
in the outliner when you see "View Layer").
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tools.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 40ade8a821d..c4d032e34ee 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -675,6 +675,7 @@ typedef enum eOutliner_PropModifierOps { typedef enum eOutliner_PropCollectionOps { OL_COLLECTION_OP_OBJECTS_ADD = 1, OL_COLLECTION_OP_OBJECTS_REMOVE, + OL_COLLECTION_OP_OBJECTS_SELECT, OL_COLLECTION_OP_COLLECTION_NEW, OL_COLLECTION_OP_COLLECTION_DEL, OL_COLLECTION_OP_COLLECTION_UNLINK, @@ -860,6 +861,10 @@ static void collection_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tsel WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene); te->store_elem->flag &= ~TSE_SELECTED; } + else if (event == OL_COLLECTION_OP_OBJECTS_SELECT) { + BKE_layer_collection_objects_select(lc); + WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene); + } else if (event == OL_COLLECTION_OP_COLLECTION_NEW) { if (GS(id->name) == ID_GR) { BKE_collection_add(id, sc, COLLECTION_TYPE_GROUP_INTERNAL, NULL); @@ -1844,6 +1849,7 @@ void OUTLINER_OT_modifier_operation(wmOperatorType *ot) static EnumPropertyItem prop_collection_op_types[] = { {OL_COLLECTION_OP_OBJECTS_ADD, "OBJECTS_ADD", ICON_ZOOMIN, "Add Selected", "Add selected objects to collection"}, {OL_COLLECTION_OP_OBJECTS_REMOVE, "OBJECTS_REMOVE", ICON_X, "Remove Selected", "Remove selected objects from collection"}, + {OL_COLLECTION_OP_OBJECTS_SELECT, "OBJECTS_SELECT", ICON_RESTRICT_SELECT_OFF, "Select Objects", "Selected collection objects"}, {OL_COLLECTION_OP_COLLECTION_NEW, "COLLECTION_NEW", ICON_NEW, "New Collection", "Add a new nested collection"}, {OL_COLLECTION_OP_COLLECTION_UNLINK, "COLLECTION_UNLINK", ICON_UNLINKED, "Unlink", "Unlink collection"}, {OL_COLLECTION_OP_COLLECTION_DEL, "COLLECTION_DEL", ICON_X, "Delete Collection", "Delete the collection"}, @@ -1880,7 +1886,10 @@ static int outliner_collection_operation_invoke(bContext *C, wmOperator *op, con for (int i = 0; i < (ARRAY_SIZE(prop_collection_op_types) - 1); i++, prop++) { if (soops->outlinevis != SO_GROUPS || - !ELEM(prop->value, OL_COLLECTION_OP_COLLECTION_UNLINK, OL_COLLECTION_OP_GROUP_CREATE)) + !ELEM(prop->value, + OL_COLLECTION_OP_OBJECTS_SELECT, + OL_COLLECTION_OP_COLLECTION_UNLINK, + OL_COLLECTION_OP_GROUP_CREATE)) { uiItemEnumO_ptr(layout, ot, NULL, prop->icon, "type", prop->value); } |