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:
authorDalai Felinto <dfelinto@gmail.com>2017-12-01 16:24:21 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-12-01 19:15:54 +0300
commitbe9e469ead227aee8d4c29b98a125cf599c5c8bb (patch)
tree381ee3e58a94495a923c575bb8185899d84ab4bc /source/blender/render
parente8c15e0ed15f8369d0d0f706b4953fb64e357902 (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/render')
-rw-r--r--source/blender/render/intern/source/convertblender.c67
1 files changed, 37 insertions, 30 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 81ed4c71b17..74de3fcded6 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -68,6 +68,7 @@
#include "BKE_displist.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
+#include "BKE_group.h"
#include "BKE_key.h"
#include "BKE_image.h"
#include "BKE_lattice.h"
@@ -3979,28 +3980,32 @@ static bool is_object_hidden(Render *re, Object *ob)
/* layflag: allows material group to ignore layerflag */
static void add_lightgroup(Render *re, Group *group, int exclusive)
{
- GroupObject *go, *gol;
-
group->id.tag &= ~LIB_TAG_DOIT;
+#if 0
/* it's a bit too many loops in loops... but will survive */
/* note that 'exclusive' will remove it from the global list */
- for (go= group->gobject.first; go; go= go->next) {
- go->lampren= NULL;
+ FOREACH_GROUP_BASE(group, base)
+ {
+ Object *object = base->object;
- if (is_object_hidden(re, go->ob))
+ if (is_object_hidden(re, object)) {
continue;
-
- if (go->ob->lay & re->lay) {
- if (go->ob && go->ob->type==OB_LAMP) {
- for (gol= re->lights.first; gol; gol= gol->next) {
- if (gol->ob==go->ob) {
- go->lampren= gol->lampren;
+ }
+
+ if (base->flag & BASE_VISIBLED) {
+ if (object && object->type == OB_LAMP) {
+ for (GroupObject *gol = re->lights.first; gol; gol = gol->next) {
+ if (gol->ob == object) {
+ go->lampren = gol->lampren;
break;
}
}
- if (go->lampren==NULL)
- gol= add_render_lamp(re, go->ob);
+
+ if (go->lampren == NULL) {
+ gol= add_render_lamp(re, object);
+ }
+
if (gol && exclusive) {
BLI_remlink(&re->lights, gol);
MEM_freeN(gol);
@@ -4008,6 +4013,10 @@ static void add_lightgroup(Render *re, Group *group, int exclusive)
}
}
}
+ FOREACH_GROUP_BASE_END
+#else
+ UNUSED_VARS(re, exclusive);
+#endif
}
static void set_material_lightgroups(Render *re)
@@ -4899,8 +4908,6 @@ static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, in
{
/* ugly function, but we need to set particle systems to their render
* settings before calling object_duplilist, to get render level duplis */
- Group *group;
- GroupObject *go;
ParticleSystem *psys;
DerivedMesh *dm;
@@ -4932,11 +4939,13 @@ static void dupli_render_particle_set(Render *re, Object *ob, int timeoffset, in
}
}
- if (ob->dup_group==NULL) return;
- group= ob->dup_group;
+ if (ob->dup_group == NULL) return;
- for (go= group->gobject.first; go; go= go->next)
- dupli_render_particle_set(re, go->ob, timeoffset, level+1, enable);
+ FOREACH_GROUP_OBJECT(ob->dup_group, object)
+ {
+ dupli_render_particle_set(re, object, timeoffset, level+1, enable);
+ }
+ FOREACH_GROUP_OBJECT_END
}
static int get_vector_viewlayers(Scene *UNUSED(sce))
@@ -4946,29 +4955,27 @@ static int get_vector_viewlayers(Scene *UNUSED(sce))
static void add_group_render_dupli_obs(Render *re, Group *group, int nolamps, int onlyselected, Object *actob, int timeoffset, int level)
{
- GroupObject *go;
- Object *ob;
-
- /* simple preventing of too deep nested groups */
- if (level>MAX_DUPLI_RECUR) return;
-
- /* recursively go into dupligroups to find objects with OB_RENDER_DUPLI
- * that were not created yet */
- for (go= group->gobject.first; go; go= go->next) {
- ob= go->ob;
+ /* Simple preventing of too deep nested groups. */
+ if (level > MAX_DUPLI_RECUR) return;
+ /* Recursively go into dupligroups to find objects with OB_RENDER_DUPLI
+ * that were not created yet. */
+ FOREACH_GROUP_OBJECT(group, ob)
+ {
if (ob->flag & OB_DONE) {
if (ob->transflag & OB_RENDER_DUPLI) {
if (allow_render_object(re, ob, nolamps, onlyselected, actob)) {
init_render_object(re, ob, NULL, NULL, NULL, timeoffset);
ob->transflag &= ~OB_RENDER_DUPLI;
- if (ob->dup_group)
+ if (ob->dup_group) {
add_group_render_dupli_obs(re, ob->dup_group, nolamps, onlyselected, actob, timeoffset, level+1);
+ }
}
}
}
}
+ FOREACH_GROUP_OBJECT_END
}
static void database_init_objects(Render *re, unsigned int UNUSED(renderlay), int nolamps, int onlyselected, Object *actob, int timeoffset)