diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-16 17:37:52 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-01-16 17:37:52 +0300 |
commit | 1e0283828f4bd0330ef1c58a957c60edaa095ed3 (patch) | |
tree | 5d85f377652bedf7a7a5a0ce9a31f17763a4fd31 | |
parent | 263f61493286cbcfb8ee6b86979d50794e358128 (diff) |
Depsgraph: pass depsgraph to editors update context struct
This way callbacks will know which depsgraph is being changed, and where
evaluated data is coming from.
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 4 | ||||
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph.h | 2 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 3 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 1 | ||||
-rw-r--r-- | source/blender/editors/render/render_update.c | 2 |
5 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index a462e5b215c..91e03337397 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1435,7 +1435,7 @@ void BKE_scene_graph_update_tagged(EvaluationContext *eval_ctx, /* Update sound system animation (TODO, move to depsgraph). */ BKE_sound_update_scene(bmain, scene); /* Inform editors about possible changes. */ - DEG_ids_check_recalc(bmain, scene, view_layer, false); + DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, false); /* Clear recalc flags. */ DEG_ids_clear_recalc(bmain); } @@ -1482,7 +1482,7 @@ void BKE_scene_graph_update_for_newframe(EvaluationContext *eval_ctx, /* Notify editors and python about recalc. */ BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_FRAME_CHANGE_POST); /* Inform editors about possible changes. */ - DEG_ids_check_recalc(bmain, scene, view_layer, true); + DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, true); /* clear recalc flags */ DEG_ids_clear_recalc(bmain); } diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index 4f45768cbea..4d3f36b5fba 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -194,6 +194,7 @@ void DEG_graph_flush_update(struct Main *bmain, Depsgraph *depsgraph); * editors about this. */ void DEG_ids_check_recalc(struct Main *bmain, + struct Depsgraph *depsgraph, struct Scene *scene, struct ViewLayer *view_layer, bool time); @@ -248,6 +249,7 @@ bool DEG_needs_eval(Depsgraph *graph); typedef struct DEGEditorUpdateContext { struct Main *bmain; + struct Depsgraph *depsgraph; struct Scene *scene; struct ViewLayer *view_layer; } DEGEditorUpdateContext; diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 2255e1ce1b9..b2e32b766e7 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -239,6 +239,7 @@ void depsgraph_update_editors_tag(Main *bmain, Depsgraph *graph, ID *id) /* TODO(sergey): Make sure this works for CoW-ed datablocks as well. */ DEGEditorUpdateContext update_ctx = {NULL}; update_ctx.bmain = bmain; + update_ctx.depsgraph = (::Depsgraph *)graph; update_ctx.scene = graph->scene; update_ctx.view_layer = graph->view_layer; deg_editors_id_update(&update_ctx, id); @@ -454,6 +455,7 @@ void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) * editors about this. */ void DEG_ids_check_recalc(Main *bmain, + Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, bool time) @@ -476,6 +478,7 @@ void DEG_ids_check_recalc(Main *bmain, DEGEditorUpdateContext update_ctx = {NULL}; update_ctx.bmain = bmain; + update_ctx.depsgraph = depsgraph; update_ctx.scene = scene; update_ctx.view_layer = view_layer; DEG::deg_editors_scene_update(&update_ctx, (updated || time)); diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 74c3cd28455..04bfb200743 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -268,6 +268,7 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) /* Prepare update context for editors. */ DEGEditorUpdateContext update_ctx; update_ctx.bmain = bmain; + update_ctx.depsgraph = (::Depsgraph *)graph; update_ctx.scene = graph->scene; update_ctx.view_layer = graph->view_layer; /* Do actual flush. */ diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index 42109662129..1de37f2eff7 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -202,6 +202,8 @@ void ED_render_engine_changed(Main *bmain) for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { update_ctx.scene = scene; LINKLIST_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { + /* TDODO(sergey): Iterate over depsgraphs instead? */ + update_ctx.depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); update_ctx.view_layer = view_layer; ED_render_id_flush_update(&update_ctx, &scene->id); } |