diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-20 14:33:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-11-20 14:33:16 +0300 |
commit | 0b413e406d7335a9a5d7d7b2ba2ae4f199d2fbcf (patch) | |
tree | 0eb6aadbb65aa0cbe277dcde86741acc1129c847 /source/blender/blenkernel/intern/anim.c | |
parent | a8777f905846f80385fc90135e000c3169bbefc6 (diff) |
Avoid passing context to motion path calculation
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index eb63ea5250d..7a0bf54f1f2 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -54,6 +54,7 @@ #include "BKE_anim.h" #include "BKE_report.h" +#include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" // XXX bad level call... @@ -341,15 +342,11 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) * - recalc: whether we need to */ /* TODO: include reports pointer? */ -void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets) + void animviz_calc_motionpaths(EvaluationContext *eval_ctx, Main *bmain, Scene *scene, ListBase *targets) { MPathTarget *mpt; 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 */ if (ELEM(NULL, targets, targets->first)) @@ -372,7 +369,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, scene_layer, depsgraph); + motionpaths_calc_update_scene(bmain, scene, eval_ctx->scene_layer, eval_ctx->depsgraph); /* perform baking for targets */ motionpaths_calc_bake_targets(scene, targets); @@ -380,7 +377,7 @@ void animviz_calc_motionpaths(bContext *C, Scene *scene, ListBase *targets) /* reset original environment */ CFRA = cfra; - motionpaths_calc_update_scene(bmain, scene, scene_layer, depsgraph); + motionpaths_calc_update_scene(bmain, scene, eval_ctx->scene_layer, eval_ctx->depsgraph); /* clear recalc flags from targets */ for (mpt = targets->first; mpt; mpt = mpt->next) { |