Fix T64302: objects disappearing when disabling overlays

Only happened for Cycles, after recent changes.

Differential Revision: https://developer.blender.org/D4826
This commit is contained in:
Jeroen Bakker 2019-05-08 16:52:42 +02:00 committed by Brecht Van Lommel
parent 5aaa00ed55
commit f273141556
Notes: blender-bot 2023-02-14 09:38:57 +01:00
Referenced by issue #64350, Grid not showing up in top orthographic view
Referenced by issue #64351, crash on attempt to open a specific file
Referenced by issue #64326, Screw modifier on curves crash Blender 2.80
1 changed files with 4 additions and 1 deletions

View File

@ -1559,7 +1559,10 @@ void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph,
drw_engines_world_update(scene);
/* Only iterate over objects for internal engines or when overlays are enabled */
if ((engine_type->flag & RE_INTERNAL) != 0 || (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) {
const bool internal_engine = (engine_type->flag & RE_INTERNAL) != 0;
const bool draw_type_render = v3d->shading.type == OB_RENDER;
const bool overlays_on = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0;
if (internal_engine || overlays_on || !draw_type_render) {
const int object_type_exclude_viewport = v3d->object_type_exclude_viewport;
const int iter_flag = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY |
DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | DEG_ITER_OBJECT_FLAG_VISIBLE |