diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-21 18:29:14 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-21 18:43:24 +0300 |
commit | b89f2276e502da6480b4ceeb414b0e6b79e4edfe (patch) | |
tree | 77d5756979af9137e645fcdfc3fff5dc36702b4a /source/blender/draw/modes/object_mode.c | |
parent | 103dd660573bb77b8917387bb2773a96de56fb38 (diff) |
Implement duplicator viewport/render visibility options
This allows a duplicator (as known as dupli parent) to be in a visible
collection so its duplicated objects are visible, however while being
invisible for the final render.
An object that is a particle emitter is also considered a duplicator.
Many thanks for the reviewers for the extense feedback.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D2966
Diffstat (limited to 'source/blender/draw/modes/object_mode.c')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 3d84611f94d..e3800d87a53 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1648,7 +1648,7 @@ static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl static void DRW_shgroup_relationship_lines(OBJECT_StorageList *stl, Object *ob) { - if (ob->parent && BKE_object_is_visible(ob->parent)) { + if (ob->parent && DRW_check_object_visible_within_active_context(ob->parent)) { DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->obmat[3]); DRW_shgroup_call_dynamic_add(stl->g_data->relationship_lines, ob->parent->obmat[3]); } @@ -1763,6 +1763,15 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) View3D *v3d = draw_ctx->v3d; int theme_id = TH_UNDEFINED; + /* Handle particles first in case the emitter itself shouldn't be rendered. */ + if (ob->type == OB_MESH) { + OBJECT_cache_populate_particles(ob, psl); + } + + if (DRW_check_object_visible_within_active_context(ob) == false) { + 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"); @@ -1800,8 +1809,6 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) } } } - - OBJECT_cache_populate_particles(ob, psl); break; } case OB_SURF: |