Motion Path Calcs: Minor optimisation tweaks

* Don't print on every frame evaluated. This was only needed
  earlier to track the progress (and why things were taking so
  long - answer, it was the Scene COW issue). Saves 50-100 ms

* Remove the extra calculation of the scene after evaluating
  motion paths. This shouldn't be needed now with COW.
  Saves about 20-30 ms
This commit is contained in:
Joshua Leung 2018-08-23 16:29:06 +12:00
parent dcefce5eae
commit 8ee06f50c0
1 changed files with 6 additions and 4 deletions

View File

@ -466,10 +466,8 @@ static void motionpaths_calc_bake_targets(ListBase *targets, int cframe)
}
/* calculate path over requested range */
printf("Calculating Paths over Frame Range:\n");
printf("Calculating MotionPaths between frames %d - %d (%d frames)\n", sfra, efra, efra - sfra + 1);
for (CFRA = sfra; CFRA <= efra; CFRA++) {
printf(" Frame %d\n", CFRA);
/* update relevant data for new frame */
motionpaths_calc_update_scene(bmain, depsgraph);
@ -478,8 +476,12 @@ static void motionpaths_calc_bake_targets(ListBase *targets, int cframe)
}
/* reset original environment */
/* NOTE: We shouldn't need to reevaluate the main scene,
* as the depsgraph passed in calculates the results on a
* a copy-on-write copy of the data. That said, we have to
* restore the current frame settings
*/
CFRA = cfra;
motionpaths_calc_update_scene(bmain, depsgraph); // XXX: Soon to be obsolete
/* clear recalc flags from targets */
for (mpt = targets->first; mpt; mpt = mpt->next) {