Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2018-08-23 07:29:06 +0300
committerJoshua Leung <aligorith@gmail.com>2018-08-23 08:07:38 +0300
commit8ee06f50c059e23802bde0b9eacf28f3871df79f (patch)
tree654c392dca1d3be1ee49c9d5bcbe14e1e42a174a /source/blender/blenkernel/intern/anim.c
parentdcefce5eae9bdcc2b0fdcbc371fcf17e0ef0ada0 (diff)
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
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c10
1 files changed, 6 insertions, 4 deletions
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) {