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>2012-07-03 05:15:03 +0400
committerJoshua Leung <aligorith@gmail.com>2012-07-03 05:15:03 +0400
commitf977da407b9229099da73ae71d51d0f3355132b1 (patch)
tree0fa2a6e6732d6d094e2fa76887333fed87026e28 /source/blender/blenkernel/intern/action.c
parent4aa43a0bfdc9c5172ae7cceb68f81627fac4558e (diff)
Bugfix [#31976] Bone Group Custom color set is not respected when creating an
Action Custom color set colors were not getting copied over when creating new action groups. Instead, a "default set" was initialised for use instead.
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index b3d2e3371f4..8d1707725b5 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -253,7 +253,7 @@ void set_active_action_group(bAction *act, bActionGroup *agrp, short select)
}
/* Sync colors used for action/bone group with theme settings */
-void action_group_colors_sync(bActionGroup *grp)
+void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
{
/* only do color copying if using a custom color (i.e. not default color) */
if (grp->customCol) {
@@ -265,9 +265,15 @@ void action_group_colors_sync(bActionGroup *grp)
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) {
+ /* if a reference group is provided, use the custom color from there... */
+ if (ref_grp) {
+ /* assumption: reference group has a color set */
+ memcpy(&grp->cs, &ref_grp->cs, sizeof(ThemeWireColor));
+ }
+ /* otherwise, init custom color with a generic/placeholder color set if
+ * no previous theme color was used that we can just keep using
+ */
+ else 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);