diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-02-14 08:00:23 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-02-14 08:00:23 +0300 |
commit | 5beaeb9f4bb1582071cf6bd72a7276a54cc4e95a (patch) | |
tree | 70813d66b5825de2ab484c9ce81b2a8b61e08ee4 /source/blender/src/drawarmature.c | |
parent | b4f975b91a4294a4a7a32bab58eac2158bc7debe (diff) |
== Custom Bone Colours - Per Group Colour-Sets ==
Now it is possible to define a custom colour set per bone group. This allows rigs to look consistent across different computers with different themes. As such, the bone-groups buttons have been reshuffled to present the settings in a better way.
Colour sets are now selected from a menu with descriptive names, instead of using a slider. Choose the 'Custom Set' entry to use a custom set of colours for the active group. The sets of theme colours have been retained, and can be used directly, or as the basis for a new custom colour set (when any one of the colour controls is touched).
For bone-groups that haven't had any custom colour set used yet, a default 'test' set is used. This uses bright versions of the RGB colours.
Diffstat (limited to 'source/blender/src/drawarmature.c')
-rw-r--r-- | source/blender/src/drawarmature.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c index 66cd9a7a716..9b8905b782b 100644 --- a/source/blender/src/drawarmature.c +++ b/source/blender/src/drawarmature.c @@ -109,6 +109,7 @@ static void set_pchan_colorset (Object *ob, bPoseChannel *pchan) { bPose *pose= (ob) ? ob->pose : NULL; bArmature *arm= (ob) ? ob->data : NULL; + bActionGroup *grp= NULL; short color_index= 0; /* sanity check */ @@ -123,7 +124,7 @@ static void set_pchan_colorset (Object *ob, bPoseChannel *pchan) * has been set to use one */ if (pchan->agrp_index) { - bActionGroup *grp= (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1)); + grp= (bActionGroup *)BLI_findlink(&pose->agroups, (pchan->agrp_index - 1)); if (grp) color_index= grp->customCol; } @@ -132,10 +133,14 @@ static void set_pchan_colorset (Object *ob, bPoseChannel *pchan) /* bcolor is a pointer to the color set to use. If NULL, then the default * color set (based on the theme colors for 3d-view) is used. */ - if (color_index) { + if (color_index > 0) { bTheme *btheme= U.themes.first; bcolor= &btheme->tarm[(color_index - 1)]; } + else if (color_index == -1) { + /* use the group's own custom color set */ + bcolor= (grp)? &grp->cs : NULL; + } else bcolor= NULL; } |