diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-01-11 15:56:15 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-01-18 15:58:31 +0300 |
commit | b4530deec478e1982156a2a76bd4bdadaf651fb3 (patch) | |
tree | cc771351425a8ac4b957616676d0692c082e28e1 /source/blender/editors/object | |
parent | dfdf79fb03a8eec6e6cd2a098405ae13b00a05ae (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/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 24157ad34a1..c6d6b8b16b9 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1730,7 +1730,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op) BLI_strncpy(nlt->name, DATA_("SoundTrack"), sizeof(nlt->name)); BKE_nlastrip_validate_name(adt, strip); - WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_ADDED, NULL); } return OPERATOR_FINISHED; |