[Bf-blender-cvs] [8ee06f50c05] blender2.8: Motion Path Calcs: Minor optimisation tweaks

Joshua Leung noreply at git.blender.org
Thu Aug 23 07:11:26 CEST 2018


Commit: 8ee06f50c059e23802bde0b9eacf28f3871df79f
Author: Joshua Leung
Date:   Thu Aug 23 16:29:06 2018 +1200
Branches: blender2.8
https://developer.blender.org/rB8ee06f50c059e23802bde0b9eacf28f3871df79f

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

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

M	source/blender/blenkernel/intern/anim.c

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

diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index ece3a018a9e..68f691e4b1c 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -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) {



More information about the Bf-blender-cvs mailing list