diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-14 16:46:49 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-15 13:56:48 +0300 |
commit | 1f5106de610b115b87ab6121d7871d447ca48cd2 (patch) | |
tree | d929ef94556eac6063c24983cc6b89f52075701c /source/blender/draw | |
parent | 7402b8ec74b4f74371d92816d22869ec9bd95da4 (diff) |
Group collection viewport/render options and remove collection visibility
Users can change the group collection visibility in the outliner
when looking at groups.
Regular collections on the other hand don't have any special visibility control,
if you need a collection to be invisible during render, either don't link it
into the view layer used for F12, or disable it.
This includes:
* Updated unittests - update your lib/tests/layers folder.
* Subversion bump - branches be aware of that.
Note:
Although we are using eval_ctx to determine the visibility of a group collection
when rendering, the depsgraph is still using the same depsgraph for the viewport
and the render engine, so at the moment the render visibility is ignored.
Following next is a workaround for this separately to tag the groups before and
after rendering to tackle that.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_engine.c | 4 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 9 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 4 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 4 |
4 files changed, 4 insertions, 17 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 6f6992a2256..f24381e1fb4 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -114,10 +114,6 @@ static void eevee_cache_populate(void *vedata, Object *ob) } if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) { - if (!BKE_object_is_visible(ob)) { - return; - } - EEVEE_materials_cache_populate(vedata, sldata, ob); const bool cast_shadow = true; diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index d7ccc1a5336..fed8460e008 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -685,8 +685,7 @@ static void EEVEE_planar_reflections_updates(EEVEE_ViewLayerData *sldata, EEVEE_ eplanar->attenuation_bias = max_dist * -eplanar->attenuation_scale; /* Debug Display */ - if (BKE_object_is_visible(ob) && - DRW_state_draw_support() && + if (DRW_state_draw_support() && (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) { DRW_shgroup_call_dynamic_add(stl->g_data->planar_display_shgrp, &ped->probe_id, ob->obmat); @@ -734,8 +733,7 @@ static void EEVEE_lightprobes_updates(EEVEE_ViewLayerData *sldata, EEVEE_PassLis invert_m4(eprobe->parallaxmat); /* Debug Display */ - if (BKE_object_is_visible(ob) && - DRW_state_draw_support() && + if (DRW_state_draw_support() && (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) { ped->probe_size = probe->data_draw_size * 0.1f; @@ -816,8 +814,7 @@ static void EEVEE_lightprobes_updates(EEVEE_ViewLayerData *sldata, EEVEE_PassLis len_v3(egrid->increment_z)) + 1.0f; /* Debug Display */ - if (BKE_object_is_visible(ob) && - DRW_state_draw_support() && + if (DRW_state_draw_support() && (probe->flag & LIGHTPROBE_FLAG_SHOW_DATA)) { struct Gwn_Batch *geom = DRW_cache_sphere_get(); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 525289f51b9..2ab5b9dd758 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2214,9 +2214,7 @@ bool DRW_object_is_renderable(Object *ob) Scene *scene = DST.draw_ctx.scene; Object *obedit = scene->obedit; - if (!BKE_object_is_visible(ob)) { - return false; - } + BLI_assert(BKE_object_is_visible(ob)); if (ob->type == OB_MESH) { if (ob == obedit) { diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 91b64818eff..3d84611f94d 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1763,10 +1763,6 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) View3D *v3d = draw_ctx->v3d; int theme_id = TH_UNDEFINED; - if (!BKE_object_is_visible(ob)) { - return; - } - //CollectionEngineSettings *ces_mode_ob = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_OBJECT, ""); //bool do_wire = BKE_collection_engine_property_value_get_bool(ces_mode_ob, "show_wire"); |