From d325e6f0e845d710abe4847a57be8e30920911a9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 9 Nov 2017 11:20:17 +0100 Subject: 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. --- source/blender/blenkernel/intern/anim.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/anim.c') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 23fbcf583ad..eb63ea5250d 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -276,7 +276,10 @@ void animviz_get_object_motionpaths(Object *ob, ListBase *targets) /* ........ */ /* update scene for current frame */ -static void motionpaths_calc_update_scene(Main *bmain, Scene *scene, struct Depsgraph *depsgraph) +static void motionpaths_calc_update_scene(Main *bmain, + Scene *scene, + SceneLayer *scene_layer, + struct Depsgraph *depsgraph) { /* Do all updates * - if this is too slow, resort to using a more efficient way @@ -288,7 +291,7 @@ static void motionpaths_calc_update_scene(Main *bmain, Scene *scene, struct Deps * * TODO(sergey): Use evaluation context dedicated to motion paths. */ - BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene); + BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer); } /* ........ */ @@ -344,6 +347,8 @@ void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets) int sfra, efra; int cfra; Main *bmain = CTX_data_main(C); + /* TODO(sergey): Should we mabe pass scene layer explicitly? */ + SceneLayer *scene_layer = CTX_data_scene_layer(C); struct Depsgraph *depsgraph = CTX_data_depsgraph(C); /* sanity check */ @@ -367,7 +372,7 @@ void animviz_calc_motionpaths(bContext *C, 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, depsgraph); + motionpaths_calc_update_scene(bmain, scene, scene_layer, depsgraph); /* perform baking for targets */ motionpaths_calc_bake_targets(scene, targets); @@ -375,7 +380,7 @@ void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets) /* reset original environment */ CFRA = cfra; - motionpaths_calc_update_scene(bmain, scene, depsgraph); + motionpaths_calc_update_scene(bmain, scene, scene_layer, depsgraph); /* clear recalc flags from targets */ for (mpt = targets->first; mpt; mpt = mpt->next) { -- cgit v1.2.3