From b5f5e6ce2981971783511d3bc9adeddc674e1715 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 30 Apr 2018 15:16:11 +0200 Subject: Depsgraph: Fix missing node tree update when adding keyframes Need to make sure animation data is copied from original tree to a copy, it is NOT enough to only copy node socket values. --- source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/depsgraph/intern') diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 193c1c38710..d07c8c737ad 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -78,6 +78,7 @@ extern "C" { #endif #include "BKE_action.h" +#include "BKE_animsys.h" #include "BKE_editmesh.h" #include "BKE_library_query.h" #include "BKE_object.h" @@ -603,6 +604,13 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, create_placeholders); } +static void deg_update_copy_on_write_animation(const Depsgraph * /*depsgraph*/, + const IDDepsNode *id_node) +{ + DEG_debug_print_eval(__func__, id_node->id_orig->name, id_node->id_cow); + BKE_animdata_copy_id(NULL, id_node->id_cow, id_node->id_orig, false); +} + ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDDepsNode *id_node) { @@ -657,6 +665,7 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, ID_RECALC_ANIMATION | ID_RECALC_COPY_ON_WRITE); if ((id_cow->recalc & ~ignore_flag) == 0) { + deg_update_copy_on_write_animation(depsgraph, id_node); return id_cow; } break; -- cgit v1.2.3