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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-01-11 15:56:15 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-01-18 15:58:31 +0300
commitb4530deec478e1982156a2a76bd4bdadaf651fb3 (patch)
treecc771351425a8ac4b957616676d0692c082e28e1 /source/blender/editors/animation
parentdfdf79fb03a8eec6e6cd2a098405ae13b00a05ae (diff)
Fix T84586: missing Outliner redraws for certain NLA operators
Outliner display under 'Animation' > 'NLA Tracks' was not updating in the following cases: - adding strips - removing strips - duplicating strips (possibly to different track) - swapping strips - reordering tracks - changing strip order by translating - translating strips between tracks - renaming tracks In the case of deleting strips/tracks, this was also resulting in a use- after-free error in Outliner drawing code (this was reported specifically in T84586). Most of these operators already sent a ND_NLA|NA_EDITED notifier, but the Outliner is not listening to these. Listening to NA_EDITED is also not what we want since this also happens a lot in cases irrelevant to the Outliner. Now be a bit more specific and send ND_NLA|NA_ADDED / ND_NLA| NA_REMOVED or a new ND_NLA_ORDER (to distinguish from NA_EDITED 'only' - where a redraw is not neccessary) and listen to these from the Outliner. (note: places that were listening to ND_NLA|NA_EDITED before are also listening to NA_ADDED or NA_REMOVED, so changing NA_EDITED should not be a problem here) (note 2: for cases like swapping tracks/strips order, NA_ADDED or NA_REMOVED does not make sense, neither can we use NA_EDITED [since we dont want to listen to this], so in this case an additional ND_NLA_ORDER is now sent) (note 3: in nla transform code, this is now always sent on confirm. There are cases were the notifier would not be needed, but checking exactly all cases were it actually would be needed seems overkill [history of D10073 has example code to check if strips moved between tracks]) Maniphest Tasks: T84586 Differential Revision: https://developer.blender.org/D10073
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index ac226b36e21..a7d02c0e6fb 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -1580,6 +1580,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
/* send notifier that things have changed */
WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION | ND_NLA_ORDER, NULL);
return OPERATOR_FINISHED;
}
@@ -2900,6 +2901,7 @@ static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), const
/* handle click */
if (rename_anim_channels(&ac, channel_index)) {
+ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_RENAME, NULL);
return OPERATOR_FINISHED;
}