diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-14 15:32:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-14 18:42:58 +0300 |
commit | a415d521dbe217b1a670f6d2f3ddcade5029db79 (patch) | |
tree | bf93d9c4aadb6e60b056d0622c2d3b2d02500bb4 /source/blender/blenkernel | |
parent | 898c780633ad8d288b76305d6a6bc3caa1ad4050 (diff) |
Fix object motion paths not updating correct after filtering optimization.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_anim.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h index 998f0dd09b8..91f936c6eca 100644 --- a/source/blender/blenkernel/BKE_anim.h +++ b/source/blender/blenkernel/BKE_anim.h @@ -57,7 +57,11 @@ void animviz_free_motionpath(struct bMotionPath *mpath); struct bMotionPath *animviz_verify_motionpaths(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan); void animviz_get_object_motionpaths(struct Object *ob, ListBase *targets); -void animviz_calc_motionpaths(struct Depsgraph *depsgraph, struct Main *bmain, struct Scene *scene, ListBase *targets); +void animviz_calc_motionpaths(struct Depsgraph *depsgraph, + struct Main *bmain, + struct Scene *scene, + ListBase *targets, + bool restore); /* ---------------------------------------------------- */ /* Curve Paths */ diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 68f691e4b1c..02f871e6ccf 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -401,7 +401,11 @@ static void motionpaths_calc_bake_targets(ListBase *targets, int cframe) * - recalc: whether we need to */ /* TODO: include reports pointer? */ - void animviz_calc_motionpaths(Depsgraph *depsgraph, Main *bmain, Scene *scene, ListBase *targets) +void animviz_calc_motionpaths(Depsgraph *depsgraph, + Main *bmain, + Scene *scene, + ListBase *targets, + bool restore) { MPathTarget *mpt; int sfra, efra; @@ -476,12 +480,13 @@ 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 - */ + /* NOTE: We don't always need to reevaluate the main scene, as the depsgraph + * may be a temporary one that works on a subset of the data. We always have + * to resoture the current frame though. */ CFRA = cfra; + if (restore) { + motionpaths_calc_update_scene(bmain, depsgraph); + } /* clear recalc flags from targets */ for (mpt = targets->first; mpt; mpt = mpt->next) { |