From eb727124852083be13f9fff5ce1def4ffe2a0959 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 20 Nov 2013 19:03:55 +1300 Subject: Ported over logic for which animchannel settings are supported by NLA Tracks --- .../editors/animation/anim_channels_defines.c | 39 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/animation/anim_channels_defines.c') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 977e0194c1f..02e3c6a7aa2 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2795,9 +2795,42 @@ static short acf_nlatrack_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem AnimData *adt = ale->adt; /* visibility of settings depends on various states... */ - - // XXX: - return 0; + switch (setting) { + /* always supported */ + case ACHANNEL_SETTING_SELECT: + case ACHANNEL_SETTING_SOLO: + return 1; + + /* conditionally supported... */ + case ACHANNEL_SETTING_PROTECT: + case ACHANNEL_SETTING_MUTE: + /* if this track is active and we're tweaking it, don't draw these toggles */ + if (((nlt->flag & NLATRACK_ACTIVE) && (nlt->flag & NLATRACK_DISABLED)) == 0) { + /* is track enabled for solo drawing? */ + if ((adt) && (adt->flag & ADT_NLA_SOLO_TRACK)) { + if (nlt->flag & NLATRACK_SOLO) { + /* ok - we've got a solo track, and this is it */ + return 1; + } + else { + /* not ok - we've got a solo track, but this isn't it, so make it more obvious */ + return 0; + } + } + + + /* ok - no tracks are solo'd, and this isn't being tweaked */ + return 1; + } + else { + /* unsupported - this track is being tweaked */ + return 0; + } + + /* unsupported */ + default: + return 0; + } } /* get the appropriate flag(s) for the setting when it is valid */ -- cgit v1.2.3