Commit: e01a9c5eeeaa61a63103c4eb63af2b752306871c
Author: Joshua Leung
Date:   Thu Aug 23 14:06:11 2018 +1200
Branches: blender2.8
https://developer.blender.org/rBe01a9c5eeeaa61a63103c4eb63af2b752306871c

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.

===================================================================

M       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 */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to