Add theme settings for keyframe indication in 3D View
authorGaia Clary <gaia.clary@machinimatrix.org>
Mon, 1 Feb 2016 13:01:02 +0000 (14:01 +0100)
committerGaia Clary <gaia.clary@machinimatrix.org>
Mon, 1 Feb 2016 13:09:43 +0000 (14:09 +0100)
source/blender/editors/interface/resources.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/makesrna/intern/rna_userdef.c

index ad7d5c3ffcf86c323d56e094d88517bc7fd31ae4..18bf409f2df7d14e7a84a67213b194cac4c8711e 100644 (file)
@@ -2685,6 +2685,15 @@ void init_userdef_do_versions(void)
                }
        }
 
+       if (!USER_VERSION_ATLEAST(276, 10)) {
+               bTheme *btheme;
+               for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+                       /* 3dView Keyframe Indicators */
+                       rgba_char_args_set(btheme->tv3d.time_keyframe, 0xDD, 0xD7, 0x00, 1.0);
+                       rgba_char_args_set(btheme->tv3d.time_gp_keyframe, 0xB5, 0xE6, 0x1D, 1.0);
+               }
+       }
+
        if (U.pixelsize == 0.0f)
                U.pixelsize = 1.0f;
        
index adffcb63293df9a494c39d9c4f11c964bc9435cc..32ba0590cbbd459cb2707355a9238efdbb83871e 100644 (file)
@@ -943,9 +943,9 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
                
                /* color depends on whether there is a keyframe */
                if (id_frame_has_keyframe((ID *)ob, /* BKE_scene_frame_get(scene) */ (float)cfra, ANIMFILTER_KEYS_LOCAL))
-                       UI_ThemeColor(TH_VERTEX_SELECT);
+                       UI_ThemeColor(TH_TIME_KEYFRAME);
                else if (ED_gpencil_has_keyframe_v3d(scene, ob, cfra))
-                       UI_ThemeColor(TH_CFRAME); // XXX
+                       UI_ThemeColor(TH_TIME_GP_KEYFRAME);
                else
                        UI_ThemeColor(TH_TEXT_HI);
        }
index f29cbe6ce186385a14fcbe36eb046eee17e84b06..0692a200224643637d879327c78a56c4feb7b07e 100644 (file)
@@ -1757,7 +1757,19 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
        RNA_def_property_array(prop, 4);
        RNA_def_property_ui_text(prop, "Clipping Border", "");
        RNA_def_property_update(prop, 0, "rna_userdef_update");
-       
+
+       prop = RNA_def_property(srna, "text_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", "Color for indicating Object keyframes");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+       prop = RNA_def_property(srna, "text_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 for indicating Grease Pencil keyframes");
+       RNA_def_property_update(prop, 0, "rna_userdef_update");
+
        rna_def_userdef_theme_spaces_paint_curves(srna);
 }