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>2008-04-16 15:02:08 +0400
committerJoshua Leung <aligorith@gmail.com>2008-04-16 15:02:08 +0400
commitd482b3285cdbfc85b5031fc7223b8ffe96619562 (patch)
tree65a9a75ac30d1a572bfde69ba7ec5eb9f82fdc01 /source/blender/src/drawaction.c
parent68418a9bce5f724a78d1b48d6166be1af3132d5f (diff)
== Action Editor - Group Colours for Channels ==
It is now possible for Action Channels to be displayed using the colour of its group. The colour for an Action Group is only set when it is auto-created by keyframing (controls to tweak this may/may-not be added, time permitting). To enable the display of these colours, the View -> 'Use Group Colors' must be enabled. However, this is disabled by default.
Diffstat (limited to 'source/blender/src/drawaction.c')
-rw-r--r--source/blender/src/drawaction.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index 1d3ece58db7..c761bed1fec 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -462,6 +462,7 @@ static void draw_channel_names(void)
if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) ||
IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) )
{
+ bActionGroup *grp = NULL;
short indent= 0, offset= 0, sel= 0, group=0;
int expand= -1, protect = -1, special= -1, mute = -1;
char name[32];
@@ -495,6 +496,8 @@ static void draw_channel_names(void)
bActionChannel *achan= (bActionChannel *)ale->data;
group= (ale->grp) ? 1 : 0;
+ grp= ale->grp;
+
indent = 0;
special = -1;
@@ -524,7 +527,9 @@ static void draw_channel_names(void)
bConstraintChannel *conchan = (bConstraintChannel *)ale->data;
indent = 2;
+
group= (ale->grp) ? 1 : 0;
+ grp= ale->grp;
if (EDITABLE_CONCHAN(conchan))
protect = ICON_UNLOCKED;
@@ -548,7 +553,9 @@ static void draw_channel_names(void)
indent = 2;
protect = -1; // for now, until this can be supported by others
+
group= (ale->grp) ? 1 : 0;
+ grp= ale->grp;
if (icu->flag & IPO_MUTE)
mute = ICON_MUTE_IPO_ON;
@@ -581,7 +588,9 @@ static void draw_channel_names(void)
indent = 1;
special = geticon_ipo_blocktype(achan->ipo->blocktype);
+
group= (ale->grp) ? 1 : 0;
+ grp= ale->grp;
if (FILTER_IPO_ACHAN(achan))
expand = ICON_TRIA_DOWN;
@@ -598,7 +607,9 @@ static void draw_channel_names(void)
indent = 1;
special = ICON_CONSTRAINT;
+
group= (ale->grp) ? 1 : 0;
+ grp= ale->grp;
if (FILTER_CON_ACHAN(achan))
expand = ICON_TRIA_DOWN;
@@ -625,8 +636,28 @@ static void draw_channel_names(void)
offset = 0;
}
else {
- /* for normal channels */
- BIF_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
+ /* for normal channels
+ * - use 3 shades of color group/standard colour for 3 indention level
+ * - use standard colour if enabled
+ */
+ if ((G.saction->flag & SACTION_DRAWGCOLORS) && (grp)) {
+ char cp[3];
+
+ if (indent == 2) {
+ VECCOPY(cp, grp->cs.solid);
+ }
+ else if (indent == 1) {
+ VECCOPY(cp, grp->cs.select);
+ }
+ else {
+ VECCOPY(cp, grp->cs.active);
+ }
+
+ glColor3ub(cp[0], cp[1], cp[2]);
+ }
+ else
+ BIF_ThemeColorShade(TH_HEADER, ((indent==0)?20: (indent==1)?-20: -40));
+
indent += group;
offset = 7 * indent;
glRectf(x+offset, yminc, (float)NAMEWIDTH, ymaxc);