Commit: a1e2415ed51e2da97e3b182f18f462345a02ce14
Author: Brecht Van Lommel
Date:   Fri Apr 6 11:21:20 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa1e2415ed51e2da97e3b182f18f462345a02ce14

Depsgraph: don't pass evaluation context to update functions.

The depsgraph now contains all the state needed to evaluate it.

Differential Revision: https://developer.blender.org/D3147

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

M       source/blender/alembic/intern/abc_exporter.cc
M       source/blender/alembic/intern/abc_exporter.h
M       source/blender/alembic/intern/alembic_capi.cc
M       source/blender/blenkernel/BKE_scene.h
M       source/blender/blenkernel/BKE_workspace.h
M       source/blender/blenkernel/intern/anim.c
M       source/blender/blenkernel/intern/pointcache.c
M       source/blender/blenkernel/intern/scene.c
M       source/blender/blenkernel/intern/sequencer.c
M       source/blender/blenkernel/intern/workspace.c
M       source/blender/depsgraph/DEG_depsgraph.h
M       source/blender/depsgraph/intern/depsgraph_eval.cc
M       source/blender/depsgraph/intern/eval/deg_eval.cc
M       source/blender/depsgraph/intern/eval/deg_eval.h
M       source/blender/editors/include/ED_screen.h
M       source/blender/editors/object/object_add.c
M       source/blender/editors/object/object_bake_api.c
M       source/blender/editors/physics/dynamicpaint_ops.c
M       source/blender/editors/physics/physics_fluid.c
M       source/blender/editors/render/render_internal.c
M       source/blender/editors/render/render_opengl.c
M       source/blender/editors/render/render_preview.c
M       source/blender/editors/scene/scene_edit.c
M       source/blender/editors/screen/screen_edit.c
M       source/blender/editors/screen/screen_ops.c
M       source/blender/editors/sound/sound_ops.c
M       source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
M       source/blender/makesrna/intern/rna_scene_api.c
M       source/blender/render/extern/include/RE_engine.h
M       source/blender/render/intern/source/convertblender.c
M       source/blender/render/intern/source/external_engine.c
M       source/blender/windowmanager/intern/wm_event_system.c
M       source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/alembic/intern/abc_exporter.cc 
b/source/blender/alembic/intern/abc_exporter.cc
index 945f82e8827..ed5b59d08e2 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -168,7 +168,7 @@ static bool export_object(const ExportSettings * const 
settings, const Base * co
 
 /* ************************************************************************** 
*/
 
-AbcExporter::AbcExporter(Main *bmain, EvaluationContext *eval_ctx, Scene 
*scene, ViewLayer *view_layer,
+AbcExporter::AbcExporter(Main *bmain, EvaluationContext *eval_ctx, Scene 
*scene,
                          Depsgraph *depsgraph,
                          const char *filename, ExportSettings &settings)
     : m_bmain(bmain)
@@ -178,7 +178,6 @@ AbcExporter::AbcExporter(Main *bmain, EvaluationContext 
*eval_ctx, Scene *scene,
     , m_shape_sampling_index(0)
     , m_eval_ctx(eval_ctx)
     , m_scene(scene)
-    , m_view_layer(view_layer)
     , m_depsgraph(depsgraph)
     , m_writer(NULL)
 {}
@@ -657,5 +656,5 @@ void AbcExporter::setCurrentFrame(Main *bmain, double t)
 {
        m_scene->r.cfra = static_cast<int>(t);
        m_scene->r.subframe = static_cast<float>(t) - m_scene->r.cfra;
-       BKE_scene_graph_update_for_newframe(bmain->eval_ctx, m_depsgraph, 
bmain, m_scene, m_view_layer);
+       BKE_scene_graph_update_for_newframe(m_depsgraph, bmain);
 }
diff --git a/source/blender/alembic/intern/abc_exporter.h 
b/source/blender/alembic/intern/abc_exporter.h
index 2a34ad2b25d..9c9c21af12f 100644
--- a/source/blender/alembic/intern/abc_exporter.h
+++ b/source/blender/alembic/intern/abc_exporter.h
@@ -95,7 +95,6 @@ class AbcExporter {
 
        EvaluationContext *m_eval_ctx;
        Scene *m_scene;
-       ViewLayer *m_view_layer;
        Depsgraph *m_depsgraph;
 
        ArchiveWriter *m_writer;
@@ -107,7 +106,7 @@ class AbcExporter {
        std::vector<AbcObjectWriter *> m_shapes;
 
 public:
-       AbcExporter(Main *bmain, EvaluationContext *eval_ctx, Scene *scene, 
ViewLayer *view_layer,
+       AbcExporter(Main *bmain, EvaluationContext *eval_ctx, Scene *scene,
                    Depsgraph *depsgraph,
                    const char *filename, ExportSettings &settings);
        ~AbcExporter();
diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index d54719c47e2..cb01efb2cf4 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -265,8 +265,7 @@ static void export_startjob(void *customdata, short *stop, 
short *do_update, flo
 
        try {
                Scene *scene = data->scene;
-               ViewLayer *view_layer = data->view_layer;
-               AbcExporter exporter(data->bmain, &data->eval_ctx, scene, 
view_layer, data->depsgraph, data->filename, data->settings);
+               AbcExporter exporter(data->bmain, &data->eval_ctx, scene, 
data->depsgraph, data->filename, data->settings);
 
                const int orig_frame = CFRA;
 
@@ -276,7 +275,7 @@ static void export_startjob(void *customdata, short *stop, 
short *do_update, flo
                if (CFRA != orig_frame) {
                        CFRA = orig_frame;
 
-                       
BKE_scene_graph_update_for_newframe(data->bmain->eval_ctx, data->depsgraph, 
data->bmain, scene, data->view_layer);
+                       BKE_scene_graph_update_for_newframe(data->depsgraph, 
data->bmain);
                }
 
                data->export_ok = !data->was_canceled;
diff --git a/source/blender/blenkernel/BKE_scene.h 
b/source/blender/blenkernel/BKE_scene.h
index bd36bb000b4..4a97cb763dc 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -139,17 +139,11 @@ void  BKE_scene_frame_set(struct Scene *scene, double 
cfra);
 
 /* **  Scene evaluation ** */
 
-void BKE_scene_graph_update_tagged(struct EvaluationContext *eval_ctx,
-                                   struct Depsgraph *depsgraph,
-                                   struct Main *bmain,
-                                   struct Scene *scene,
-                                   struct ViewLayer *view_layer);
-
-void BKE_scene_graph_update_for_newframe(struct EvaluationContext *eval_ctx,
-                                         struct Depsgraph *depsgraph,
-                                         struct Main *bmain,
-                                         struct Scene *scene,
-                                         struct ViewLayer *view_layer);
+void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph,
+                                   struct Main *bmain);
+
+void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph,
+                                         struct Main *bmain);
 
 struct SceneRenderView *BKE_scene_add_render_view(struct Scene *sce, const 
char *name);
 bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView 
*srv);
diff --git a/source/blender/blenkernel/BKE_workspace.h 
b/source/blender/blenkernel/BKE_workspace.h
index 9ba4105edda..32a9bcbec61 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -125,8 +125,7 @@ bool BKE_workspace_use_scene_settings_get(const struct 
WorkSpace *workspace) GET
 void BKE_workspace_use_scene_settings_set(struct WorkSpace *workspace, bool 
value) SETTER_ATTRS;
 
 /* Update / evaluate */
-void BKE_workspace_update_tagged(struct EvaluationContext *eval_ctx,
-                                 struct Main *bmain,
+void BKE_workspace_update_tagged(struct Main *bmain,
                                  struct WorkSpace *workspace,
                                  struct Scene *scene);
 
diff --git a/source/blender/blenkernel/intern/anim.c 
b/source/blender/blenkernel/intern/anim.c
index 62df97c6afa..0b964145c7f 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -278,8 +278,6 @@ void animviz_get_object_motionpaths(Object *ob, ListBase 
*targets)
 
 /* update scene for current frame */
 static void motionpaths_calc_update_scene(Main *bmain,
-                                          Scene *scene,
-                                          ViewLayer *view_layer,
                                           struct Depsgraph *depsgraph)
 {
        /* Do all updates
@@ -292,7 +290,7 @@ static void motionpaths_calc_update_scene(Main *bmain,
         *
         * TODO(sergey): Use evaluation context dedicated to motion paths.
         */
-       BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, 
scene, view_layer);
+       BKE_scene_graph_update_for_newframe(depsgraph, bmain);
 }
 
 /* ........ */
@@ -369,7 +367,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, 
ListBase *targets)
        /* calculate path over requested range */
        for (CFRA = sfra; CFRA <= efra; CFRA++) {
                /* update relevant data for new frame */
-               motionpaths_calc_update_scene(bmain, scene, 
eval_ctx->view_layer, eval_ctx->depsgraph);
+               motionpaths_calc_update_scene(bmain, eval_ctx->depsgraph);
                
                /* perform baking for targets */
                motionpaths_calc_bake_targets(scene, targets);
@@ -377,7 +375,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, 
ListBase *targets)
        
        /* reset original environment */
        CFRA = cfra;
-       motionpaths_calc_update_scene(bmain, scene, eval_ctx->view_layer, 
eval_ctx->depsgraph);
+       motionpaths_calc_update_scene(bmain, eval_ctx->depsgraph);
        
        /* clear recalc flags from targets */
        for (mpt = targets->first; mpt; mpt = mpt->next) {
diff --git a/source/blender/blenkernel/intern/pointcache.c 
b/source/blender/blenkernel/intern/pointcache.c
index afaf68dde24..50314daa014 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3679,7 +3679,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
        stime = ptime = PIL_check_seconds_timer();
 
        for (int fr = CFRA; fr <= endframe; fr += baker->quick_step, CFRA = fr) 
{
-               BKE_scene_graph_update_for_newframe(G.main->eval_ctx, 
depsgraph, bmain, scene, view_layer);
+               BKE_scene_graph_update_for_newframe(depsgraph, bmain);
 
                if (baker->update_progress) {
                        float progress = ((float)(CFRA - 
startframe)/(float)(endframe - startframe));
@@ -3765,7 +3765,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
        CFRA = cfrao;
        
        if (bake) { /* already on cfra unless baking */
-               BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, 
bmain, scene, view_layer);
+               BKE_scene_graph_update_for_newframe(depsgraph, bmain);
        }
 
        /* TODO: call redraw all windows somehow */
diff --git a/source/blender/blenkernel/intern/scene.c 
b/source/blender/blenkernel/intern/scene.c
index 596599deb75..9a7c10d31de 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1387,17 +1387,12 @@ static void prepare_mesh_for_viewport_render(
 /* TODO(sergey): This actually should become view_layer_graph or so.
  * Same applies to update_for_newframe.
  */
-void BKE_scene_graph_update_tagged(EvaluationContext *eval_ctx,
-                                   Depsgraph *depsgraph,
-                                   Main *bmain,
-                                   Scene *scene,
-                                   ViewLayer *view_layer)
+void BKE_scene_graph_update_tagged(Depsgraph *depsgraph,
+                                   Main *bmain)
 {
-       /* 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);
-       }
+       Scene *scene = DEG_get_input_scene(depsgraph);
+       ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph);
+
        /* TODO(sergey): Some functions here are changing global state,
         * for example, clearing update tags from bmain.
         */
@@ -1412,7 +1407,7 @@ void BKE_scene_graph_update_tagged(EvaluationContext 
*eval_ctx,
        /* Update all objects: drivers, matrices, displists, etc. flags set
         * by depgraph or manual, no layer check here, gets correct flushed.
         */
-       DEG_evaluate_on_refresh(eval_ctx, depsgraph);
+       DEG_evaluate_on_refresh(depsgraph);
        /* Update sound system animation (TODO, move to depsgraph). */
        BKE_sound_update_scene(bmain, scene);
        /* Inform editors about possible changes. */
@@ -1422,12 +1417,12 @@ void BKE_scene_graph_update_tagged(EvaluationContext 
*eval_ctx,
 }
 
 /* applies changes right away, does all sets too */
-void BKE_scene_graph_update_for_newframe(Evaluat

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to