Draw Manager: Fix Background sets not being drawn.
authorClément Foucault <foucault.clem@gmail.com>
Tue, 11 Apr 2017 14:11:45 +0000 (16:11 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 11 Apr 2017 14:13:29 +0000 (16:13 +0200)
source/blender/draw/intern/draw_manager.c

index 1260decb071a3e7c799de3489ce2a2db9a2ae904..a2f25f604a4c3e60e9f424862ec331e4fc9200eb 100644 (file)
@@ -1797,14 +1797,29 @@ void DRW_draw_view(const bContext *C)
        /* ideally only refresh when objects are added/removed */
        /* or render properties / materials change */
        if (cache_is_dirty) {
-               SceneLayer *sl = CTX_data_scene_layer(C);
+               SceneLayer *sl;
+               Scene *scene = CTX_data_scene(C);
 
                DRW_engines_cache_init();
+
+               /* draw set first */
+               if (scene->set) {
+                       sl = BKE_scene_layer_render_active(scene->set);
+                       DEG_OBJECT_ITER(sl, ob);
+                       {
+                               ob->base_flag &= ~BASE_SELECTED;
+                               DRW_engines_cache_populate(ob);
+                       }
+                       DEG_OBJECT_ITER_END
+               }
+
+               sl = CTX_data_scene_layer(C);
                DEG_OBJECT_ITER(sl, ob);
                {
                        DRW_engines_cache_populate(ob);
                }
                DEG_OBJECT_ITER_END
+
                DRW_engines_cache_finish();
        }