diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-09 13:20:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-09 13:20:17 +0300 |
commit | d325e6f0e845d710abe4847a57be8e30920911a9 (patch) | |
tree | 13138d409459bbe7e223833a8f6a5000437585e6 /source/blender/blenkernel/intern/scene.c | |
parent | c99481b6320a77e4793c812403f7d37dfc2d5ced (diff) |
Depsgraph: Make dependency graph to be built from scene layer
This is a final step of having proper ownership. Now selecting different
layers in the "top bar" will actually do what this is expected to do.
Surely, there are still things to be done under the hood, that will happen
in a less intrusive way.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 95f10cc9846..ccdd785986d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1537,13 +1537,19 @@ static void prepare_mesh_for_viewport_render(Main *bmain, Scene *scene) void BKE_scene_graph_update_tagged(EvaluationContext *eval_ctx, Depsgraph *depsgraph, Main *bmain, - Scene *scene) + Scene *scene, + SceneLayer *scene_layer) { + /* TODO(sergey): Temporary solution for until pipeline.c is ported. */ + if (scene_layer == NULL) { + scene_layer = DEG_get_evaluated_scene_layer(depsgraph); + BLI_assert(scene_layer != NULL); + } /* TODO(sergey): Some functions here are changing global state, * for example, clearing update tags from bmain. */ /* (Re-)build dependency graph if needed. */ - DEG_graph_relations_update(depsgraph, bmain, scene); + DEG_graph_relations_update(depsgraph, bmain, scene, scene_layer); /* Uncomment this to check if graph was properly tagged for update. */ // DEG_debug_graph_relations_validate(depsgraph, bmain, scene); /* Flush editing data if needed. */ @@ -1566,8 +1572,14 @@ void BKE_scene_graph_update_tagged(EvaluationContext *eval_ctx, void BKE_scene_graph_update_for_newframe(EvaluationContext *eval_ctx, Depsgraph *depsgraph, Main *bmain, - Scene *scene) + Scene *scene, + SceneLayer *scene_layer) { + /* TODO(sergey): Temporary solution for until pipeline.c is ported. */ + if (scene_layer == NULL) { + scene_layer = DEG_get_evaluated_scene_layer(depsgraph); + BLI_assert(scene_layer != NULL); + } /* TODO(sergey): Some functions here are changing global state, * for example, clearing update tags from bmain. */ @@ -1583,7 +1595,7 @@ void BKE_scene_graph_update_for_newframe(EvaluationContext *eval_ctx, */ BKE_image_update_frame(bmain, scene->r.cfra); BKE_sound_set_cfra(scene->r.cfra); - DEG_graph_relations_update(depsgraph, bmain, scene); + DEG_graph_relations_update(depsgraph, bmain, scene, scene_layer); /* Update animated cache files for modifiers. * * TODO(sergey): Make this a depsgraph node? |