diff options
author | Diego Garcia <diego@sinestesia.co> | 2015-01-03 14:48:29 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-01-03 15:17:51 +0300 |
commit | f329ebe38a19ec11ccc7fbf0c3ad71f52685aac9 (patch) | |
tree | 45775b847ba1f46a6916c702bc05447a362e3c0d /source/blender | |
parent | c50003cd09ab8d3477406f58f00e530e5e67b45f (diff) |
D824: Add themeing for keyframe lines in Timeline
Reviewed by: Joshua Leung (aligorith)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_time/space_time.c | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 12 |
5 files changed, 29 insertions, 3 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 23936f76103..e6db938a1b0 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -111,6 +111,8 @@ enum { TH_FACE_DOT, TH_FACEDOT_SIZE, TH_CFRAME, + TH_TIME_KEYFRAME, + TH_TIME_GP_KEYFRAME, TH_NURB_ULINE, TH_NURB_VLINE, TH_NURB_SEL_ULINE, diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index f89d017fb89..941ef08b8e1 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -372,6 +372,10 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo cp = ts->keyborder_select; break; case TH_CFRAME: cp = ts->cframe; break; + case TH_TIME_KEYFRAME: + cp = ts->time_keyframe; break; + case TH_TIME_GP_KEYFRAME: + cp = ts->time_gp_keyframe; break; case TH_NURB_ULINE: cp = ts->nurb_uline; break; case TH_NURB_VLINE: @@ -1126,6 +1130,9 @@ void ui_theme_init_default(void) rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0); rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); /* sliders */ + rgba_char_args_set(btheme->ttime.time_keyframe, 0xDD, 0xD7, 0x00, 1.0); + rgba_char_args_set(btheme->ttime.time_gp_keyframe, 0xB5, 0xE6, 0x1D, 1.0); + /* space node, re-uses syntax and console color storage */ btheme->tnode = btheme->tv3d; rgba_char_args_set(btheme->tnode.syntaxr, 115, 115, 115, 255); /* wire inner color */ @@ -2539,6 +2546,10 @@ void init_userdef_do_versions(void) rgba_char_args_set(btheme->tnode.gp_vertex, 0, 0, 0, 255); rgba_char_args_set(btheme->tnode.gp_vertex_select, 255, 133, 0, 255); btheme->tnode.gp_vertex_size = 3; + + /* Timeline Keyframe Indicators */ + rgba_char_args_set(btheme->ttime.time_keyframe, 0xDD, 0xD7, 0x00, 1.0); + rgba_char_args_set(btheme->ttime.time_gp_keyframe, 0xB5, 0xE6, 0x1D, 1.0); } } diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 69a1853b7f1..7709980d12e 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -349,7 +349,7 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar) /* draw grease pencil keyframes (if available) */ if (gpd) { - glColor3ub(0xB5, 0xE6, 0x1D); + UI_ThemeColor(TH_TIME_GP_KEYFRAME); time_draw_idblock_keyframes(v2d, (ID *)gpd, onlysel); } @@ -359,7 +359,7 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar) */ if (onlysel == 0) { /* set draw color */ - glColor3ub(0xDD, 0xA7, 0x00); + UI_ThemeColorShade(TH_TIME_KEYFRAME, -50); time_draw_idblock_keyframes(v2d, (ID *)scene, onlysel); } @@ -368,7 +368,7 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar) * OR the onlysel flag was set, which means that only active object's keyframes should * be considered */ - glColor3ub(0xDD, 0xD7, 0x00); + UI_ThemeColor(TH_TIME_KEYFRAME); if (ob && ((ob->mode == OB_MODE_POSE) || onlysel)) { /* draw keyframes for active object only */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 7e589ad1b53..11807ba5338 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -251,6 +251,7 @@ typedef struct ThemeSpace { char bone_solid[4], bone_pose[4], bone_pose_active[4]; char strip[4], strip_select[4]; char cframe[4]; + char time_keyframe[4], time_gp_keyframe[4]; char freestyle_edge_mark[4], freestyle_face_mark[4]; char nurb_uline[4], nurb_vline[4]; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index c2bcdfb77eb..fa0e1db10e2 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2274,6 +2274,18 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "time_keyframe", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "time_keyframe"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Keyframe", "Base color for keyframe indicator lines"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "time_grease_pencil", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "time_gp_keyframe"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Grease Pencil", "Color of Grease Pencil keyframes"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_image(BlenderRNA *brna) |