Workbench: respect the duplication visibility flag

This commit is contained in:
Jeroen Bakker 2018-06-07 08:25:22 +02:00
parent 2d2f23de10
commit 7fb216d800
2 changed files with 9 additions and 1 deletions

View File

@ -661,7 +661,6 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
WORKBENCH_StorageList *stl = vedata->stl;
WORKBENCH_PassList *psl = vedata->psl;
WORKBENCH_PrivateData *wpd = stl->g_data;
if (!DRW_object_is_renderable(ob))
return;
@ -669,6 +668,10 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
workbench_cache_populate_particles(vedata, ob);
}
if (!DRW_check_object_visible_within_active_context(ob)) {
return;
}
WORKBENCH_MaterialData *material;
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
const DRWContextState *draw_ctx = DRW_context_state_get();

View File

@ -517,6 +517,11 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
if (ob->type == OB_MESH) {
workbench_forward_cache_populate_particles(vedata, ob);
}
if (!DRW_check_object_visible_within_active_context(ob)) {
return;
}
if (ELEM(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
const DRWContextState *draw_ctx = DRW_context_state_get();
const bool is_active = (ob == draw_ctx->obact);