Fix T65630: Paste pose doesn't work with motion paths enabled

This commit is contained in:
Sergey Sharybin 2019-06-14 17:12:47 +02:00
parent 0cd720e3a5
commit 648a352bbf
Notes: blender-bot 2023-02-14 09:19:09 +01:00
Referenced by issue #65630, paste pose doesn't work
1 changed files with 18 additions and 2 deletions

View File

@ -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;