[Bf-blender-cvs] [d1a1302b01f] master: UI: add NLA track and channel theme color

Brecht Van Lommel noreply at git.blender.org
Wed Oct 2 18:58:13 CEST 2019


Commit: d1a1302b01f445f9c877d6b8c51f6c561e0fda16
Author: Brecht Van Lommel
Date:   Wed Oct 2 18:36:51 2019 +0200
Branches: master
https://developer.blender.org/rBd1a1302b01f445f9c877d6b8c51f6c561e0fda16

UI: add NLA track and channel theme color

Patch contributed by Paul (Thirio).

Differential Revision: https://developer.blender.org/D5967

===================================================================

M	release/datafiles/userdef/userdef_default_theme.c
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/resources.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c
index 80bed03debf..0b9e8beccc1 100644
--- a/release/datafiles/userdef/userdef_default_theme.c
+++ b/release/datafiles/userdef/userdef_default_theme.c
@@ -585,6 +585,7 @@ const bTheme U_theme_default = {
     .anim_preview_range = RGBA(0xa14d0066),
     .nla_tweaking = RGBA(0x4df31a4d),
     .nla_tweakdupli = RGBA(0xd90000ff),
+    .nla_track = RGBA(0x424242ff),
     .nla_transition = RGBA(0x1c2630ff),
     .nla_transition_sel = RGBA(0x2e75dbff),
     .nla_meta = RGBA(0x332642ff),
@@ -746,12 +747,12 @@ const bTheme U_theme_default = {
       .back = RGBA(0x333333b3),
       .sub_back = RGBA(0x0000003e),
     },
+    .active = RGBA(0x3b5689ff),
     .vertex_size = 3,
     .outline_width = 1,
     .facedot_size = 4,
     .match = RGBA(0x337f334c),
     .selected_highlight = RGBA(0x223a5bff),
-    .active = RGBA(0x3b5689ff),
     .selected_object = RGBA(0xe96a00ff),
     .active_object = RGBA(0xffaf29ff),
     .edited_object = RGBA(0x00806266),
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index bbae1c8e85e..e769e72d8e1 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -154,6 +154,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
     FROM_DEFAULT_V4_UCHAR(tui.icon_folder);
     FROM_DEFAULT_V4_UCHAR(space_clip.path_keyframe_before);
     FROM_DEFAULT_V4_UCHAR(space_clip.path_keyframe_after);
+    copy_v4_v4_uchar(btheme->space_nla.nla_track, btheme->space_nla.header);
   }
 
 #undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index d80b96f0d74..8951677b32f 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3411,7 +3411,7 @@ static void acf_nlatrack_color(bAnimContext *UNUSED(ac), bAnimListElem *ale, flo
   }
 
   /* set color for nla track */
-  UI_GetThemeColorShade3fv(TH_HEADER, ((nonSolo == false) ? 20 : -20), r_color);
+  UI_GetThemeColorShade3fv(TH_NLA_TRACK, ((nonSolo == false) ? 20 : -20), r_color);
 }
 
 /* name for nla track entries */
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 76ab4a53eb8..89579b88d24 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -283,6 +283,7 @@ typedef enum ThemeColorID {
   TH_NLA_TWEAK,       /* 'tweaking' track in NLA */
   TH_NLA_TWEAK_DUPLI, /* error/warning flag for other strips referencing dupli strip */
 
+  TH_NLA_TRACK,
   TH_NLA_TRANSITION,
   TH_NLA_TRANSITION_SEL,
   TH_NLA_META,
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 8a570933a33..c9bfafbe764 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -841,6 +841,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
           cp = ts->nla_tweakdupli;
           break;
 
+        case TH_NLA_TRACK:
+          cp = ts->nla_track;
+          break;
         case TH_NLA_TRANSITION:
           cp = ts->nla_transition;
           break;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index f36802d33b3..75f29695eb3 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -394,6 +394,8 @@ typedef struct ThemeSpace {
   /** NLA - warning color for duplicate instances of tweaking strip. */
   unsigned char nla_tweakdupli[4];
 
+  /** NLA "Track" */
+  unsigned char nla_track[4];
   /** NLA "Transition" strips. */
   unsigned char nla_transition[4], nla_transition_sel[4];
   /** NLA "Meta" strips. */
@@ -414,7 +416,6 @@ typedef struct ThemeSpace {
   unsigned char metadatabg[4];
   unsigned char metadatatext[4];
 
-  char _pad2[4];
 } ThemeSpace;
 
 /* set of colors for use as a custom color set for Objects/Bones wire drawing */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 078af30e36c..f08a3ce93a1 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3201,6 +3201,18 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "View Sliders", "");
   RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
 
+  prop = RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "ds_channel");
+  RNA_def_property_array(prop, 3);
+  RNA_def_property_ui_text(prop, "Channel", "Nonlinear Animation Channel");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
+  prop = RNA_def_property(srna, "nla_track", PROP_FLOAT, PROP_COLOR_GAMMA);
+  RNA_def_property_float_sdna(prop, NULL, "nla_track");
+  RNA_def_property_array(prop, 3);
+  RNA_def_property_ui_text(prop, "Track", "Nonlinear Animation Track");
+  RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
   prop = RNA_def_property(srna, "active_action", PROP_FLOAT, PROP_COLOR_GAMMA);
   RNA_def_property_float_sdna(prop, NULL, "anim_active");
   RNA_def_property_array(prop, 4);



More information about the Bf-blender-cvs mailing list