[Bf-blender-cvs] [96d67c2e96c] temp-group-collections: Outliner: support Add Selected to group internal collections
Dalai Felinto
noreply at git.blender.org
Tue Nov 7 02:08:11 CET 2017
Commit: 96d67c2e96cc461d335a62d76aa63433ef37e6f6
Author: Dalai Felinto
Date: Mon Nov 6 22:29:45 2017 -0200
Branches: temp-group-collections
https://developer.blender.org/rB96d67c2e96cc461d335a62d76aa63433ef37e6f6
Outliner: support Add Selected to group internal collections
===================================================================
M source/blender/blenkernel/intern/collection.c
M source/blender/editors/space_outliner/outliner_tools.c
===================================================================
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 7b34d377226..99a2a20c0ef 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -313,6 +313,9 @@ static void collection_object_add(const ID *id, SceneCollection *sc, Object *ob)
}
else {
BLI_assert(GS(id->name) == ID_GR);
+ if ((ob->flag & OB_FROMGROUP) == 0) {
+ ob->flag |= OB_FROMGROUP;
+ }
}
BKE_layer_sync_object_link(id, sc, ob);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index dce7cd917b0..03c08193e5e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -831,7 +831,7 @@ static void collection_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tsel
if (event == OL_COLLECTION_OP_OBJECTS_ADD) {
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
- BKE_collection_object_add(&scene->id, sc, ob);
+ BKE_collection_object_add(id, sc, ob);
}
CTX_DATA_END;
@@ -1828,6 +1828,7 @@ static EnumPropertyItem prop_collection_op_none_types[] = {
};
static EnumPropertyItem prop_collection_op_group_internal_types[] = {
+ {OL_COLLECTION_OP_OBJECTS_ADD, "OBJECTS_ADD", ICON_ZOOMIN, "Add Selected", "Add selected objects to collection"},
{OL_COLLECTION_OP_COLLECTION_NEW, "COLLECTION_NEW", ICON_NEW, "New Collection", "Add a new nested collection"},
{OL_COLLECTION_OP_COLLECTION_DEL, "COLLECTION_DEL", ICON_X, "Delete Collection", "Delete the collection"},
{0, NULL, 0, NULL, NULL}
More information about the Bf-blender-cvs
mailing list