From 31f0c27ae7d6f45cfde71cca8c4f791a089452a5 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 12 May 2015 13:29:00 +0500 Subject: Depsgraph: Add additional relations/id update tags This calls are not strictly speaking needed for the old dependency graph, but due to more granular nature of upcoming depsgraph more actions requires update of relations of IDs. On the one hand this extra tags could be wrapped with if() statements, but on the other hand it makes sense to keep tag in sync so it's clear if some issue is caused by missing/extra tag or by depsgraph itself. --- source/blender/editors/animation/anim_channels_edit.c | 4 +++- source/blender/editors/animation/anim_deps.c | 4 +++- source/blender/editors/animation/drivers.c | 5 +++-- source/blender/editors/animation/keyframing.c | 4 ++++ 4 files changed, 13 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 67485248bf1..fd7551abab3 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -34,6 +34,7 @@ #include "MEM_guardedalloc.h" +#include "BKE_depsgraph.h" #include "BLI_blenlib.h" #include "BLI_utildefines.h" #include "BLI_listbase.h" @@ -1707,7 +1708,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op)) /* send notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - + DAG_relations_tag_update(CTX_data_main(C)); + return OPERATOR_FINISHED; } diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index eb57907c9ec..a38f5dbc8ea 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -73,8 +73,10 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale) /* tag AnimData for refresh so that other views will update in realtime with these changes */ adt = BKE_animdata_from_id(id); - if (adt) + if (adt) { adt->recalc |= ADT_RECALC_ANIM; + DAG_id_tag_update(id, OB_RECALC_TIME); + } /* update data */ fcu = (ale->datatype == ALE_FCURVE) ? ale->key_data : NULL; diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 08e0daf8eb9..b2a34d7c317 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -42,6 +42,7 @@ #include "DNA_texture_types.h" #include "BKE_animsys.h" +#include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_context.h" #include "BKE_report.h" @@ -450,7 +451,7 @@ static int add_driver_button_exec(bContext *C, wmOperator *op) if (success) { /* send updates */ UI_context_update_anim_flag(C); - + DAG_relations_tag_update(CTX_data_main(C)); WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX } @@ -504,7 +505,7 @@ static int remove_driver_button_exec(bContext *C, wmOperator *op) if (success) { /* send updates */ UI_context_update_anim_flag(C); - + DAG_relations_tag_update(CTX_data_main(C)); WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); // XXX } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 092408d7de5..cd7a326ffd5 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -152,6 +152,10 @@ bAction *verify_adt_action(ID *id, short add) * to the wrong places */ adt->action->idroot = GS(id->name); + + /* tag depsgraph to be rebuilt to include time dependency */ + /* XXX: we probably should have bmain passed down, but that involves altering too many API's */ + DAG_relations_tag_update(G.main); } /* return the action */ -- cgit v1.2.3