diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-04-16 15:02:08 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-04-16 15:02:08 +0400 |
commit | d482b3285cdbfc85b5031fc7223b8ffe96619562 (patch) | |
tree | 65a9a75ac30d1a572bfde69ba7ec5eb9f82fdc01 /source/blender/src/editaction.c | |
parent | 68418a9bce5f724a78d1b48d6166be1af3132d5f (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/editaction.c')
-rw-r--r-- | source/blender/src/editaction.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 6a0d50826e9..b344f94b6bd 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -1150,8 +1150,38 @@ void verify_pchan2achan_grouping (bAction *act, bPose *pose, char name[]) grp= MEM_callocN(sizeof(bActionGroup), "bActionGroup"); grp->flag |= (AGRP_ACTIVE|AGRP_SELECTED|AGRP_EXPANDED); + + /* copy name */ sprintf(grp->name, agrp->name); + /* deal with group-color copying */ + if (agrp->customCol) { + if (agrp->customCol > 0) { + /* copy theme colors on-to group's custom color in case user tries to edit color */ + bTheme *btheme= U.themes.first; + ThemeWireColor *col_set= &btheme->tarm[(agrp->customCol - 1)]; + + memcpy(&grp->cs, col_set, sizeof(ThemeWireColor)); + } + else { + /* init custom colours with a generic multi-colour rgb set, if not initialised already */ + if (agrp->cs.solid[0] == 0) { + /* define for setting colors in theme below */ + #define SETCOL(col, r, g, b, a) col[0]=r; col[1]=g; col[2]= b; col[3]= a; + + SETCOL(grp->cs.solid, 0xff, 0x00, 0x00, 255); + SETCOL(grp->cs.select, 0x81, 0xe6, 0x14, 255); + SETCOL(grp->cs.active, 0x18, 0xb6, 0xe0, 255); + + #undef SETCOL + } + else { + /* just copy color set specified */ + memcpy(&grp->cs, &agrp->cs, sizeof(ThemeWireColor)); + } + } + } + BLI_addtail(&act->groups, grp); } |