[Bf-blender-cvs] [9cfd0c17205] greasepencil-object: Annotations: Change default color for new annotation layers

Joshua Leung noreply at git.blender.org
Mon Jul 9 09:45:26 CEST 2018


Commit: 9cfd0c1720594a5ecf815acdb20a0b18cdb847a3
Author: Joshua Leung
Date:   Mon Jul 9 19:42:37 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB9cfd0c1720594a5ecf815acdb20a0b18cdb847a3

Annotations: Change default color for new annotation layers

Although we've had a default color for new Grease Pencil layers for
years, hardly anyone ever changed the default color from the old
default of black. This commit changes this default to match the
color used in the annotation pencil icons, giving it a stronger
connection to the tool, and giving users a better default color
that will make the new strokes actually visible with the default
theme.

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

M	source/blender/editors/interface/resources.c

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

diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 3a67b8ff0ba..56c243b3407 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1544,15 +1544,6 @@ void init_userdef_do_versions(Main *bmain)
 #undef USER_VERSION_ATLEAST
 #define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST((&(U)), ver, subver)
 
-
-	if (!USER_VERSION_ATLEAST(269, 9)) {
-		/* grease pencil - new layer color */
-		if (U.gpencil_new_layer_col[3] < 0.1f) {
-			/* defaults to black, but must at least be visible! */
-			U.gpencil_new_layer_col[3] = 0.9f;
-		}
-	}
-
 	if (!USER_VERSION_ATLEAST(271, 5)) {
 		U.pie_menu_radius = 100;
 		U.pie_menu_threshold = 12;
@@ -1590,6 +1581,17 @@ void init_userdef_do_versions(Main *bmain)
 		for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) {
 			memcpy(btheme, &U_theme_default, sizeof(*btheme));
 		}
+		
+		/* Annotations - new layer color
+		 * Replace anything that used to be set if it looks like was left
+		 * on the old default (i.e. black), which most users used
+		 */
+		if ((U.gpencil_new_layer_col[3] < 0.1f) || (U.gpencil_new_layer_col[0] < 0.1f)) {
+			/* - New color matches the annotation pencil icon
+			 * - Non-full alpha looks better!
+			 */
+			ARRAY_SET_ITEMS(U.gpencil_new_layer_col, 0.38f, 0.61f, 0.78f, 0.9f);
+		}
 	}
 
 	/**



More information about the Bf-blender-cvs mailing list