From 5361339ba0590abe2220a65efa53ca48b2813974 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 14 Apr 2015 16:48:34 +1200 Subject: [PATCH] Temporary fix for NLA strips not getting drawn in tweakmode with multiple strips selected When entering tweakmode on multiple strips (from different AnimData blocks) simultaneously, only the track containing the last selected strip would be shown. All the other tracks with strips being tweaked would not appear at all. --- source/blender/editors/animation/anim_filter.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index ee662c46fd0..25f2b0b43af 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1301,8 +1301,22 @@ static size_t animfilter_nla(bAnimContext *UNUSED(ac), ListBase *anim_data, bDop * - active track should still get shown though (even though it has disabled flag set) */ // FIXME: the channels after should still get drawn, just 'differently', and after an active-action channel - if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_DISABLED) && !(nlt->flag & NLATRACK_ACTIVE)) - continue; + if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_DISABLED)) { + /* NOTE: The tweaking track may not be active, if strips from different AnimData blocks + * entered tweakmode at the same time. Since this loop works both ways, we can't + * just stop on the first disabled track we encounter... + */ + if (nlt->flag & NLATRACK_ACTIVE) { + /* OK = "the" active track */ + } + else if (BLI_findindex(&nlt->strips, adt->actstrip) != -1) { + /* OK = this is the one containing the active strip */ + } + else { + /* Not OK - neither of the previous two were met, so it must be one of the "later" ones */ + continue; + } + } /* only work with this channel and its subchannels if it is editable */ if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_NLT(nlt)) {