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:
authorJoshua Leung <aligorith@gmail.com>2013-11-20 10:24:17 +0400
committerJoshua Leung <aligorith@gmail.com>2013-11-20 16:33:02 +0400
commit5efad6f6c616124b4db6210cb3bf527bb7c2a696 (patch)
tree76245e431311169eb12d699559b4dd1502b8934d /source/blender/editors/animation/anim_channels_defines.c
parenteb727124852083be13f9fff5ce1def4ffe2a0959 (diff)
Ported code for setting colour of NLA Track anim channel
Diffstat (limited to 'source/blender/editors/animation/anim_channels_defines.c')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 02e3c6a7aa2..3848eb3ef6b 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -2766,6 +2766,25 @@ static bAnimChannelType ACF_MASKLAYER =
/* NLA Track ----------------------------------------------- */
+/* get backdrop color for nla track channels */
+static void acf_nlatrack_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, float r_color[3])
+{
+ NlaTrack *nlt = (NlaTrack *)ale->data;
+ AnimData *adt = ale->adt;
+ bool nonSolo = false;
+
+ /* is track enabled for solo drawing? */
+ if ((adt) && (adt->flag & ADT_NLA_SOLO_TRACK)) {
+ if ((nlt->flag & NLATRACK_SOLO) == 0) {
+ /* tag for special non-solo handling */
+ nonSolo = true;
+ }
+ }
+
+ /* set color for nla track */
+ UI_GetThemeColorShade3fv(TH_HEADER, ((nonSolo == false) ? 20 : -20), r_color);
+}
+
/* name for nla track entries */
static void acf_nlatrack_name(bAnimListElem *ale, char *name)
{
@@ -2869,7 +2888,7 @@ static bAnimChannelType ACF_NLATRACK =
{
"NLA Track", /* type name */
- acf_generic_channel_color, /* backdrop color */ // XXX: color depends on whether track is solo or not!
+ acf_nlatrack_color, /* backdrop color */
acf_generic_channel_backdrop, /* backdrop */
acf_generic_indention_flexible, /* indent level */
acf_generic_group_offset, /* offset */ // XXX?