From e01a9c5eeeaa61a63103c4eb63af2b752306871c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 23 Aug 2018 14:06:11 +1200 Subject: Motion Path Calculations: Don't pass scene into motionpaths_calc_bake_targets() It's not needed, and actually precludes us from considering parallel evaluation in future. --- source/blender/blenkernel/intern/anim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 7df889d22b2..6168ce97f86 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -340,7 +340,7 @@ static void motionpaths_calc_update_scene(Main *bmain, /* ........ */ /* perform baking for the targets on the current frame */ -static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) +static void motionpaths_calc_bake_targets(ListBase *targets, int cframe) { MPathTarget *mpt; @@ -352,12 +352,12 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) /* current frame must be within the range the cache works for * - is inclusive of the first frame, but not the last otherwise we get buffer overruns */ - if ((CFRA < mpath->start_frame) || (CFRA >= mpath->end_frame)) { + if ((cframe < mpath->start_frame) || (cframe >= mpath->end_frame)) { continue; } /* get the relevant cache vert to write to */ - mpv = mpath->points + (CFRA - mpath->start_frame); + mpv = mpath->points + (cframe - mpath->start_frame); Object *ob_eval = mpt->ob_eval; @@ -386,7 +386,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) copy_v3_v3(mpv->co, ob_eval->obmat[3]); } - float mframe = (float)(CFRA); + float mframe = (float)(cframe); /* Tag if it's a keyframe */ if (BLI_dlrbTree_search_exact(&mpt->keys, compare_ak_cfraPtr, &mframe)) { @@ -471,7 +471,7 @@ static void motionpaths_calc_bake_targets(Scene *scene, ListBase *targets) motionpaths_calc_update_scene(bmain, depsgraph); /* perform baking for targets */ - motionpaths_calc_bake_targets(scene, targets); + motionpaths_calc_bake_targets(targets, CFRA); } /* reset original environment */ -- cgit v1.2.3