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/anim.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/anim.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 13 |
1 files changed, 9 insertions, 4 deletions
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) { |