Commit: 0416365fee074eaac47f9f1f0a0cbdeefea70f4e
Author: Dalai Felinto
Date:   Thu Feb 22 08:40:42 2018 -0300
Branches: temp-render-depsgraph
https://developer.blender.org/rB0416365fee074eaac47f9f1f0a0cbdeefea70f4e

Cleanup: Always have viewlayer when updating scene graph

===================================================================

M       source/blender/blenkernel/intern/scene.c
M       source/blender/render/intern/source/external_engine.c
M       source/blender/render/intern/source/pipeline.c

===================================================================

diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 899a911270f..954f489b885 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1451,11 +1451,6 @@ void 
BKE_scene_graph_update_for_newframe(EvaluationContext *eval_ctx,
                                          Scene *scene,
                                          ViewLayer *view_layer)
 {
-       /* TODO(sergey): Temporary solution for until pipeline.c is ported. */
-       if (view_layer == NULL) {
-               view_layer = DEG_get_evaluated_view_layer(depsgraph);
-               BLI_assert(view_layer != NULL);
-       }
        /* TODO(sergey): Some functions here are changing global state,
         * for example, clearing update tags from bmain.
         */
diff --git a/source/blender/render/intern/source/external_engine.c 
b/source/blender/render/intern/source/external_engine.c
index 0057d2c7b04..400dfa1ace0 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -42,6 +42,8 @@
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
 
+#include "DNA_object_types.h"
+
 #include "BKE_camera.h"
 #include "BKE_global.h"
 #include "BKE_colortools.h"
@@ -50,6 +52,7 @@
 #include "BKE_scene.h"
 
 #include "DEG_depsgraph.h"
+#include "DEG_depsgraph_query.h"
 
 #include "RNA_access.h"
 
@@ -632,7 +635,11 @@ void RE_engine_frame_set(RenderEngine *engine, int frame, 
float subframe)
             render_layer != NULL;
             render_layer = render_layer->next)
        {
-               BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx, 
render_layer->depsgraph, re->main, scene, NULL);
+               BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx,
+                                                   render_layer->depsgraph,
+                                                   re->main,
+                                                   re->scene,
+                                                   
DEG_get_evaluated_view_layer(render_layer->depsgraph));
        }
 
 #ifdef WITH_PYTHON
@@ -672,7 +679,11 @@ int RE_engine_render(Render *re, int do_all)
                     render_layer != NULL;
                     render_layer = render_layer->next)
                {
-                       
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx, 
render_layer->depsgraph, re->main, re->scene, NULL);
+                       
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx,
+                                                           
render_layer->depsgraph,
+                                                           re->main,
+                                                           re->scene,
+                                                           
DEG_get_evaluated_view_layer(render_layer->depsgraph));
                }
                render_update_anim_renderdata(re, &re->scene->r, 
&re->scene->view_layers);
        }
diff --git a/source/blender/render/intern/source/pipeline.c 
b/source/blender/render/intern/source/pipeline.c
index edada7a148c..56c44dce45b 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -1752,7 +1752,11 @@ static void do_render_blur_3d(Render *re)
                     render_layer != NULL;
                     render_layer = render_layer->next)
                {
-                       
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx, 
render_layer->depsgraph, re->main, re->scene, NULL);
+                       
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx,
+                                                           
render_layer->depsgraph,
+                                                           re->main,
+                                                           re->scene,
+                                                           
DEG_get_evaluated_view_layer(render_layer->depsgraph));
                }
        }
        
@@ -2703,12 +2707,11 @@ static void do_render_composite_fields_blur_3d(Render 
*re)
                                             render_layer != NULL;
                                             render_layer = render_layer->next)
                                        {
-                                               
BKE_scene_graph_update_for_newframe(
-                                                           
&render_layer->eval_ctx,
-                                                           
render_layer->depsgraph,
-                                                           re->main,
-                                                           re->scene,
-                                                           NULL);
+                                               
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx,
+                                                                               
    render_layer->depsgraph,
+                                                                               
    re->main,
+                                                                               
    re->scene,
+                                                                               
    DEG_get_evaluated_view_layer(render_layer->depsgraph));
                                        }
                                }
                                
@@ -3801,7 +3804,11 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene 
*scene, Object *camera_overri
                                     render_layer != NULL;
                                     render_layer = render_layer->next)
                                {
-                                       
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx, 
render_layer->depsgraph, bmain, scene, NULL);
+                                       
BKE_scene_graph_update_for_newframe(&render_layer->eval_ctx,
+                                                                           
render_layer->depsgraph,
+                                                                           
bmain,
+                                                                           
scene,
+                                                                           
DEG_get_evaluated_view_layer(render_layer->depsgraph));
                                }
                                continue;
                        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to