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:
authorBastien Montagne <bastien@blender.org>2020-06-30 12:47:27 +0300
committerBastien Montagne <bastien@blender.org>2020-06-30 13:19:11 +0300
commit7556530bac39189915d8936fa7158e2bfbcaf342 (patch)
treeb33a10895a0df210fd622ef84552d656c86859ac /source/blender/depsgraph
parentdeb01eb1991e49fb912ede1ef036710e51b25fc5 (diff)
LibOverride: properly tag owner ID for override refresh, when embedded one is affected.
Note that this is partially WIP code, we only take care of shapekeys here for now. Also, move this tagging for liboverride refresh into same chack as the one for tagging editors, sounds more logical that way.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_flush.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index e3d87096d65..a0a9ff7eca3 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -32,9 +32,11 @@
#include "BLI_task.h"
#include "BLI_utildefines.h"
+#include "BKE_key.h"
#include "BKE_object.h"
#include "BKE_scene.h"
+#include "DNA_key_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
@@ -251,12 +253,30 @@ void flush_editors_id_update(Depsgraph *graph, const DEGEditorUpdateContext *upd
if (deg_copy_on_write_is_expanded(id_cow)) {
if (graph->is_active && id_node->is_user_modified) {
deg_editors_id_update(update_ctx, id_orig);
- }
- if (ID_IS_OVERRIDE_LIBRARY(id_orig) && id_orig->recalc != 0) {
+
/* We only want to tag an ID for lib-override auto-refresh if it was actually tagged as
* changed. CoW IDs indirectly modified because of changes in other IDs should never
* require a lib-override diffing. */
- id_orig->tag |= LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
+ if (ID_IS_OVERRIDE_LIBRARY_REAL(id_orig)) {
+ id_orig->tag |= LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
+ }
+ else if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id_orig)) {
+ switch (GS(id_orig->name)) {
+ case ID_KE:
+ ((Key *)id_orig)->from->tag |= LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH;
+ break;
+ case ID_GR:
+ BLI_assert(id_orig->flag & LIB_EMBEDDED_DATA);
+ /* TODO. */
+ break;
+ case ID_NT:
+ BLI_assert(id_orig->flag & LIB_EMBEDDED_DATA);
+ /* TODO. */
+ break;
+ default:
+ BLI_assert(0);
+ }
+ }
}
/* Inform draw engines that something was changed. */
flush_engine_data_update(id_cow);