diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-06 12:21:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-13 15:17:37 +0300 |
commit | a1e2415ed51e2da97e3b182f18f462345a02ce14 (patch) | |
tree | 59d54c64e1e19bde4aab0d79aa2a51a66dabc877 /source/blender/blenkernel/intern/scene.c | |
parent | eec5d3a8a8a26256fbae39d4f1fb01de6a648eea (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 29 |
1 files changed, 12 insertions, 17 deletions
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(EvaluationContext *eval_ctx, - Depsgraph *depsgraph, - Main *bmain, - Scene *scene, - ViewLayer *view_layer) +void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, + Main *bmain) { + 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. */ @@ -1452,7 +1447,7 @@ void BKE_scene_graph_update_for_newframe(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_framechange(eval_ctx, bmain, depsgraph, ctime); + DEG_evaluate_on_framechange(bmain, depsgraph, ctime); /* Update sound system animation (TODO, move to depsgraph). */ BKE_sound_update_scene(bmain, scene); /* Notify editors and python about recalc. */ |