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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-11-12 16:17:57 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-11-12 16:18:33 +0300
commitaee0446b6bdc6ff384e9d66a917f6cb06f620c0a (patch)
treef2cfd422a9415248c33118743d0d2c7427bf44d4 /source/blender/editors/space_nla/nla_channels.c
parent36a3a40033298227cfc55f59580e03863c09699d (diff)
Add a lot of update tagging to operations with NLA tracks and strips.
Diffstat (limited to 'source/blender/editors/space_nla/nla_channels.c')
-rw-r--r--source/blender/editors/space_nla/nla_channels.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 002eeea9746..132a296d5a3 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -60,6 +60,9 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "DEG_depsgraph.h"
+#include "DEG_depsgraph_build.h"
+
#include "UI_view2d.h"
#include "nla_intern.h" // own include
@@ -235,6 +238,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
/* notifier flags - channel was edited */
notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+ ale->update |= ANIM_UPDATE_DEPS;
}
else if (x <= ((NLACHANNEL_BUTTON_WIDTH * 2) + offset)) {
/* toggle 'solo' */
@@ -242,6 +246,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
/* notifier flags - channel was edited */
notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+ ale->update |= ANIM_UPDATE_DEPS;
}
else if (nlaedit_is_tweakmode_on(ac) == 0) {
/* set selection */
@@ -284,6 +289,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
/* changes to NLA-Action occurred */
notifierFlags |= ND_NLA_ACTCHANGE;
+ ale->update |= ANIM_UPDATE_DEPS;
}
/* OR rest of name... */
else {
@@ -301,6 +307,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
/* changes to NLA-Action occurred */
notifierFlags |= ND_NLA_ACTCHANGE;
+ ale->update |= ANIM_UPDATE_DEPS;
}
else {
/* select/deselect */
@@ -330,6 +337,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
}
/* free channels */
+ ANIM_animdata_update(ac, &anim_data);
ANIM_animdata_freelist(&anim_data);
/* return the notifier-flags set */
@@ -411,6 +419,7 @@ void NLA_OT_channels_click(wmOperatorType *ot)
static int nlachannels_pushdown_exec(bContext *C, wmOperator *op)
{
bAnimContext ac;
+ ID *id = NULL;
AnimData *adt = NULL;
int channel_index = RNA_int_get(op->ptr, "channel_index");
@@ -429,6 +438,7 @@ static int nlachannels_pushdown_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
else {
+ id = adt_ptr.id.data;
adt = adt_ptr.data;
}
}
@@ -457,6 +467,7 @@ static int nlachannels_pushdown_exec(bContext *C, wmOperator *op)
/* grab AnimData from the channel */
adt = ale->adt;
+ id = ale->id;
/* we don't need anything here anymore, so free it all */
ANIM_animdata_freelist(&anim_data);
@@ -479,6 +490,8 @@ static int nlachannels_pushdown_exec(bContext *C, wmOperator *op)
else {
/* 'push-down' action - only usable when not in TweakMode */
BKE_nla_action_pushdown(adt);
+
+ DEG_id_tag_update_ex(CTX_data_main(C), id, DEG_TAG_TIME | DEG_TAG_COPY_ON_WRITE);
}
/* set notifier that things have changed */
@@ -597,18 +610,21 @@ bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel)
if (above_sel) {
/* just add a new one above this one */
BKE_nlatrack_add(adt, nlt);
+ ale->update = ANIM_UPDATE_DEPS;
added = true;
}
else if ((lastAdt == NULL) || (adt != lastAdt)) {
/* add one track to the top of the owning AnimData's stack, then don't add anymore to this stack */
BKE_nlatrack_add(adt, NULL);
lastAdt = adt;
+ ale->update = ANIM_UPDATE_DEPS;
added = true;
}
}
}
/* free temp data */
+ ANIM_animdata_update(ac, &anim_data);
ANIM_animdata_freelist(&anim_data);
return added;
@@ -637,11 +653,13 @@ bool nlaedit_add_tracks_empty(bAnimContext *ac)
if (BLI_listbase_is_empty(&adt->nla_tracks)) {
/* add new track to this AnimData block then */
BKE_nlatrack_add(adt, NULL);
+ ale->update = ANIM_UPDATE_DEPS;
added = true;
}
}
/* cleanup */
+ ANIM_animdata_update(ac, &anim_data);
ANIM_animdata_freelist(&anim_data);
return added;
@@ -665,6 +683,8 @@ static int nlaedit_add_tracks_exec(bContext *C, wmOperator *op)
/* done? */
if (op_done) {
+ DEG_relations_tag_update(CTX_data_main(C));
+
/* set notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL);
@@ -732,12 +752,16 @@ static int nlaedit_delete_tracks_exec(bContext *C, wmOperator *UNUSED(op))
/* call delete on this track - deletes all strips too */
BKE_nlatrack_free(&adt->nla_tracks, nlt, true);
+ ale->update = ANIM_UPDATE_DEPS;
}
}
/* free temp data */
+ ANIM_animdata_update(&ac, &anim_data);
ANIM_animdata_freelist(&anim_data);
+ DEG_relations_tag_update(ac.bmain);
+
/* set notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL);