diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-01 16:24:21 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-01 19:15:54 +0300 |
commit | be9e469ead227aee8d4c29b98a125cf599c5c8bb (patch) | |
tree | 381ee3e58a94495a923c575bb8185899d84ab4bc /source/blender/collada | |
parent | e8c15e0ed15f8369d0d0f706b4953fb64e357902 (diff) |
Groups and collection: initial integration
Since we are ditching layers from Blender (2.8) we need a replacement to
control groups visibility. This commit introduces collections as the building
blocks for groups, allowing users to control visibility as well as overrides
for groups.
Features
========
* Groups now have collections
This way you can change the visibility of a collection inside a group, and add
overrides which are part of the group and are prioritized over other overrides.
* Outliner
Groups can inspect their collections, change visibility, and add/remove members.
To change an override of a group collection, you need to select an instance of
the group, and then you can choose "group" in the collection properties editor
to edit this group active collection instead of the view layer one.
* Dupli groups overrides
We can now have multiple instances of the same group with an original "override"
and different overrides depending on the collection the instanced object is part
of.
Technical
=========
* Layers
We use the same api for groups and scene as much as possible.
Reviewers: sergey (depsgraph), mont29 (read/write and user count)
Differential Revision: https://developer.blender.org/D2892
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/SceneExporter.cpp | 12 | ||||
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 8908d0e603f..d3e23f740c8 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -267,7 +267,7 @@ void DocumentImporter::finish() std::vector<Object *>::iterator it; for (it = libnode_ob.begin(); it != libnode_ob.end(); it++) { Object *ob = *it; - BKE_collections_object_remove(G.main, sce, ob, true); + BKE_collections_object_remove(G.main, &sce->id, ob, true); } libnode_ob.clear(); diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp index aa98f2ee96c..c375c09d869 100644 --- a/source/blender/collada/SceneExporter.cpp +++ b/source/blender/collada/SceneExporter.cpp @@ -26,6 +26,7 @@ extern "C" { #include "BLI_utildefines.h" + #include "BKE_group.h" #include "BKE_object.h" #include "BLI_listbase.h" } @@ -177,12 +178,13 @@ void SceneExporter::writeNodes(const EvaluationContext *eval_ctx, Object *ob, Sc // empty object else if (ob->type == OB_EMPTY) { // TODO: handle groups (OB_DUPLIGROUP if ((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) { - GroupObject *go = NULL; - Group *gr = ob->dup_group; - /* printf("group detected '%s'\n", gr->id.name + 2); */ - for (go = (GroupObject *)(gr->gobject.first); go; go = go->next) { - printf("\t%s\n", go->ob->id.name); + Group *group = ob->dup_group; + /* printf("group detected '%s'\n", group->id.name + 2); */ + FOREACH_GROUP_OBJECT(group, object) + { + printf("\t%s\n", object->id.name); } + FOREACH_GROUP_OBJECT_END } } diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 1a6f2675cc7..6a52027fb47 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -147,7 +147,7 @@ Object *bc_add_object(Scene *scene, int type, const char *name) ViewLayer *view_layer = BKE_view_layer_context_active_PLACEHOLDER(scene); LayerCollection *layer_collection = BKE_layer_collection_get_active_ensure(scene, view_layer); - BKE_collection_object_add(scene, layer_collection->scene_collection, ob); + BKE_collection_object_add(&scene->id, layer_collection->scene_collection, ob); Base *base = BKE_view_layer_base_find(view_layer, ob); BKE_view_layer_base_select(view_layer, base); |