From 648a352bbfdb76128bbaf575f7aa23bf535f4fda Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 14 Jun 2019 17:12:47 +0200 Subject: [PATCH] Fix T65630: Paste pose doesn't work with motion paths enabled --- .../editors/animation/anim_motion_paths.c | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c index e3c4e2a8cfb..d3c6109afcd 100644 --- a/source/blender/editors/animation/anim_motion_paths.c +++ b/source/blender/editors/animation/anim_motion_paths.c @@ -250,8 +250,20 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, /* get copies of objects/bones to get the calculated results from * (for copy-on-write evaluation), so that we actually get some results */ - // TODO: Create a copy of background depsgraph that only contain these entities, - // and only evaluates them. + + /* TODO: Create a copy of background depsgraph that only contain these entities, + * and only evaluates them. + * + * For until that is done we force dependency graph to not be active, so we don't loose unkeyed + * changes during updating the motion path. + * This still doesn't include unkeyed changes to the path itself, but allows to have updates in + * an environment when auto-keying and pose paste is used. */ + + const bool is_active_depsgraph = DEG_is_active(depsgraph); + if (is_active_depsgraph) { + DEG_make_inactive(depsgraph); + } + for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { mpt->ob_eval = DEG_get_evaluated_object(depsgraph, mpt->ob); @@ -317,6 +329,10 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, motionpaths_calc_update_scene(bmain, depsgraph); } + if (is_active_depsgraph) { + DEG_make_active(depsgraph); + } + /* clear recalc flags from targets */ for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { bAnimVizSettings *avs;