[Bf-blender-cvs] [0e1613d303e] greasepencil-object: New icons for Grease Pencil sculpt brushes

Antonio Vazquez noreply at git.blender.org
Sat Jun 10 13:33:02 CEST 2017


Commit: 0e1613d303e3057f6b5b9833128f19b669eb51e3
Author: Antonio Vazquez
Date:   Sat Jun 10 13:32:50 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0e1613d303e3057f6b5b9833128f19b669eb51e3

New icons for Grease Pencil sculpt brushes

In order to keep consistency, we have added icons to GP sculpt brushes similar to object sculpt

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

A	release/datafiles/brushicons/gp_brush_clone.png
A	release/datafiles/brushicons/gp_brush_grab.png
A	release/datafiles/brushicons/gp_brush_pinch.png
A	release/datafiles/brushicons/gp_brush_push.png
A	release/datafiles/brushicons/gp_brush_randomize.png
A	release/datafiles/brushicons/gp_brush_smooth.png
A	release/datafiles/brushicons/gp_brush_strength.png
A	release/datafiles/brushicons/gp_brush_thickness.png
A	release/datafiles/brushicons/gp_brush_twist.png
M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/datafiles/CMakeLists.txt
M	source/blender/editors/include/ED_datafiles.h
M	source/blender/editors/include/UI_icons.h
M	source/blender/editors/interface/interface_icons.c
M	source/blender/makesrna/intern/rna_sculpt_paint.c

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

diff --git a/release/datafiles/brushicons/gp_brush_clone.png b/release/datafiles/brushicons/gp_brush_clone.png
new file mode 100644
index 00000000000..b76c8b57fbc
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_clone.png differ
diff --git a/release/datafiles/brushicons/gp_brush_grab.png b/release/datafiles/brushicons/gp_brush_grab.png
new file mode 100644
index 00000000000..baa19a0bab3
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_grab.png differ
diff --git a/release/datafiles/brushicons/gp_brush_pinch.png b/release/datafiles/brushicons/gp_brush_pinch.png
new file mode 100644
index 00000000000..f95b0212990
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_pinch.png differ
diff --git a/release/datafiles/brushicons/gp_brush_push.png b/release/datafiles/brushicons/gp_brush_push.png
new file mode 100644
index 00000000000..031e6007635
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_push.png differ
diff --git a/release/datafiles/brushicons/gp_brush_randomize.png b/release/datafiles/brushicons/gp_brush_randomize.png
new file mode 100644
index 00000000000..da4442d8863
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_randomize.png differ
diff --git a/release/datafiles/brushicons/gp_brush_smooth.png b/release/datafiles/brushicons/gp_brush_smooth.png
new file mode 100644
index 00000000000..878735c0b3a
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_smooth.png differ
diff --git a/release/datafiles/brushicons/gp_brush_strength.png b/release/datafiles/brushicons/gp_brush_strength.png
new file mode 100644
index 00000000000..459a3118dae
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_strength.png differ
diff --git a/release/datafiles/brushicons/gp_brush_thickness.png b/release/datafiles/brushicons/gp_brush_thickness.png
new file mode 100644
index 00000000000..8045b5ceb5c
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_thickness.png differ
diff --git a/release/datafiles/brushicons/gp_brush_twist.png b/release/datafiles/brushicons/gp_brush_twist.png
new file mode 100644
index 00000000000..2d07c891cb6
Binary files /dev/null and b/release/datafiles/brushicons/gp_brush_twist.png differ
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 89bd3b10b38..88157e1f79d 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -388,7 +388,7 @@ class GreasePencilStrokeSculptPanel:
         tool = settings.tool
         brush = settings.brush
 
-        layout.column().prop(settings, "tool")
+        layout.template_icon_view(settings, "tool", show_labels=True)
 
         col = layout.column()
         col.prop(brush, "size", slider=True)
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt
index 2a84ca7f297..f7417ca88a1 100644
--- a/source/blender/editors/datafiles/CMakeLists.txt
+++ b/source/blender/editors/datafiles/CMakeLists.txt
@@ -125,6 +125,17 @@ if(WITH_BLENDER)
 		data_to_c_simple(../../../../release/datafiles/matcaps/mc23.jpg SRC)
 		data_to_c_simple(../../../../release/datafiles/matcaps/mc24.jpg SRC)
 
+		# grease pencil sculpt
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_smooth.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_thickness.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_strength.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_grab.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_push.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_twist.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_pinch.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_randomize.png SRC)
+		data_to_c_simple(../../../../release/datafiles/brushicons/gp_brush_clone.png SRC)
+
 	endif()
 
 	data_to_c_simple(../../../../release/datafiles/startup.blend SRC)
diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h
index 661ab58b98c..4e5f302f9f7 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -239,7 +239,34 @@ extern char datatoc_mc23_jpg[];
 extern int datatoc_mc24_jpg_size;
 extern char datatoc_mc24_jpg[];
 
+/* grease pencil sculpt brushes files */
 
+extern int datatoc_gp_brush_smooth_png_size;
+extern char datatoc_gp_brush_smooth_png[];
+
+extern int datatoc_gp_brush_thickness_png_size;
+extern char datatoc_gp_brush_thickness_png[];
+
+extern int datatoc_gp_brush_strength_png_size;
+extern char datatoc_gp_brush_strength_png[];
+
+extern int datatoc_gp_brush_grab_png_size;
+extern char datatoc_gp_brush_grab_png[];
+
+extern int datatoc_gp_brush_push_png_size;
+extern char datatoc_gp_brush_push_png[];
+
+extern int datatoc_gp_brush_twist_png_size;
+extern char datatoc_gp_brush_twist_png[];
+
+extern int datatoc_gp_brush_pinch_png_size;
+extern char datatoc_gp_brush_pinch_png[];
+
+extern int datatoc_gp_brush_randomize_png_size;
+extern char datatoc_gp_brush_randomize_png[];
+
+extern int datatoc_gp_brush_clone_png_size;
+extern char datatoc_gp_brush_clone_png[];
 
 #endif /* __ED_DATAFILES_H__ */
 
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index 89748db8d71..179e5c45cdc 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -1004,6 +1004,17 @@ DEF_ICON(MATCAP_22)
 DEF_ICON(MATCAP_23)
 DEF_ICON(MATCAP_24)
 
+/* grease pencil sculpt */
+DEF_ICON(GPBRUSH_SMOOTH)
+DEF_ICON(GPBRUSH_THICKNESS)
+DEF_ICON(GPBRUSH_STRENGTH)
+DEF_ICON(GPBRUSH_GRAB)
+DEF_ICON(GPBRUSH_PUSH)
+DEF_ICON(GPBRUSH_TWIST)
+DEF_ICON(GPBRUSH_PINCH)
+DEF_ICON(GPBRUSH_RANDOMIZE)
+DEF_ICON(GPBRUSH_CLONE)
+
 /* vector icons, VICO_ prefix added */	
 DEF_VICO(SMALL_TRI_RIGHT_VEC)
 
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 88d92906040..a66569f5a26 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -415,6 +415,17 @@ static void init_brush_icons(void)
 	INIT_BRUSH_ICON(ICON_BRUSH_THUMB, thumb);
 	INIT_BRUSH_ICON(ICON_BRUSH_ROTATE, twist);
 	INIT_BRUSH_ICON(ICON_BRUSH_VERTEXDRAW, vertexdraw);
+	
+	/* grease pencil sculpt */
+	INIT_BRUSH_ICON(ICON_GPBRUSH_SMOOTH, gp_brush_smooth);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_THICKNESS, gp_brush_thickness);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_STRENGTH, gp_brush_strength);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_GRAB, gp_brush_grab);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_PUSH, gp_brush_push);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_TWIST, gp_brush_twist);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_PINCH, gp_brush_pinch);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_RANDOMIZE, gp_brush_randomize);
+	INIT_BRUSH_ICON(ICON_GPBRUSH_CLONE, gp_brush_clone);
 
 #undef INIT_BRUSH_ICON
 }
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 7465a014c53..09b81971fed 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -61,17 +61,15 @@ static EnumPropertyItem particle_edit_hair_brush_items[] = {
 };
 
 EnumPropertyItem rna_enum_gpencil_sculpt_brush_items[] = {
-	{GP_EDITBRUSH_TYPE_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth stroke points"},
-	{GP_EDITBRUSH_TYPE_THICKNESS, "THICKNESS", 0, "Thickness", "Adjust thickness of strokes"},
-	{ GP_EDITBRUSH_TYPE_STRENGTH, "STRENGTH", 0, "Strength", "Adjust color strength of strokes" },
-	{ GP_EDITBRUSH_TYPE_GRAB, "GRAB", 0, "Grab", "Translate the set of points initially within the brush circle" },
-	{GP_EDITBRUSH_TYPE_PUSH, "PUSH", 0, "Push", "Move points out of the way, as if combing them"},
-	{GP_EDITBRUSH_TYPE_TWIST, "TWIST", 0, "Twist", "Rotate points around the midpoint of the brush"},
-	{GP_EDITBRUSH_TYPE_PINCH, "PINCH", 0, "Pinch", "Pull points towards the midpoint of the brush"},
-	{GP_EDITBRUSH_TYPE_RANDOMIZE, "RANDOMIZE", 0, "Randomize", "Introduce jitter/randomness into strokes"},
-	//{GP_EDITBRUSH_TYPE_SUBDIVIDE, "SUBDIVIDE", 0, "Subdivide", "Increase point density for higher resolution strokes when zoomed in"},
-	//{GP_EDITBRUSH_TYPE_SIMPLIFY, "SIMPLIFY", 0, "Simplify", "Reduce density of stroke points"},
-	{GP_EDITBRUSH_TYPE_CLONE, "CLONE", 0, "Clone", "Paste copies of the strokes stored on the clipboard"},
+	{GP_EDITBRUSH_TYPE_SMOOTH, "SMOOTH", ICON_GPBRUSH_SMOOTH, "Smooth", "Smooth stroke points"},
+	{GP_EDITBRUSH_TYPE_THICKNESS, "THICKNESS", ICON_GPBRUSH_THICKNESS, "Thickness", "Adjust thickness of strokes"},
+	{GP_EDITBRUSH_TYPE_STRENGTH, "STRENGTH", ICON_GPBRUSH_STRENGTH, "Strength", "Adjust color strength of strokes" },
+	{GP_EDITBRUSH_TYPE_GRAB, "GRAB", ICON_GPBRUSH_GRAB, "Grab", "Translate the set of points initially within the brush circle" },
+	{GP_EDITBRUSH_TYPE_PUSH, "PUSH", ICON_GPBRUSH_PUSH, "Push", "Move points out of the way, as if combing them"},
+	{GP_EDITBRUSH_TYPE_TWIST, "TWIST", ICON_GPBRUSH_TWIST, "Twist", "Rotate points around the midpoint of the brush"},
+	{GP_EDITBRUSH_TYPE_PINCH, "PINCH", ICON_GPBRUSH_PINCH, "Pinch", "Pull points towards the midpoint of the brush"},
+	{GP_EDITBRUSH_TYPE_RANDOMIZE, "RANDOMIZE", ICON_GPBRUSH_RANDOMIZE, "Randomize", "Introduce jitter/randomness into strokes"},
+	{GP_EDITBRUSH_TYPE_CLONE, "CLONE", ICON_GPBRUSH_CLONE, "Clone", "Paste copies of the strokes stored on the clipboard"},
 	{ 0, NULL, 0, NULL, NULL }
 };




More information about the Bf-blender-cvs mailing list