diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-06-01 17:54:44 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-06-01 17:54:44 +0400 |
commit | 1ced3560099b66d70399b4a5cfbb343b36562979 (patch) | |
tree | d2927d8f403e2cb7a0526f40068d4e8873db5c48 /source/blender/makesrna/intern/rna_pose.c | |
parent | 719b3e26e768f03990be95e07f588b84deef9caa (diff) |
Action Group Colors for Bones (Part 2)
Colors used by Bone Groups are now copied/assigned to Action Groups too when
they're created now. This completes the work started in r.46960 to restore this
functionality from 2.48.
Currently, there is no control over when/whether these colors are copied over
(although it is possible to disable the display of these colors for relevant
animation editors if desired). Originally I was going to make this a more
generic Keying Sets feature, though that turned out to be a bit too complex to
manage.
Other notes:
* Split out the code for copying colors to a common library function
Diffstat (limited to 'source/blender/makesrna/intern/rna_pose.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_pose.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 83d40b26cd0..5139e17b06d 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -139,31 +139,12 @@ void rna_ActionGroup_colorset_set(PointerRNA *ptr, int value) { bActionGroup *grp = ptr->data; - /* if valid value, set the new enum value, then copy the relevant colors? */ - if ((value >= -1) && (value < 21)) + /* ensure only valid values get set */ + if ((value >= -1) && (value < 21)) { grp->customCol = value; - else - return; - /* only do color copying if using a custom color (i.e. not default color) */ - if (grp->customCol) { - if (grp->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[(grp->customCol - 1)]; - - memcpy(&grp->cs, col_set, sizeof(ThemeWireColor)); - } - else { - /* init custom colors with a generic multi-color rgb set, if not initialized already - * (for custom color set) */ - if (grp->cs.solid[0] == 0) { - /* define for setting colors in theme below */ - rgba_char_args_set(grp->cs.solid, 0xff, 0x00, 0x00, 255); - rgba_char_args_set(grp->cs.select, 0x81, 0xe6, 0x14, 255); - rgba_char_args_set(grp->cs.active, 0x18, 0xb6, 0xe0, 255); - } - } + /* sync colors stored with theme colors based on the index specified */ + action_group_colors_sync(grp); } } |