Add theme settings for keyframe indication in 3D View
This commit is contained in:
		@@ -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;
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user