[Bf-blender-cvs] [f012e1de328] greasepencil-object: Remove brush mode panel and add icon

Antonio Vazquez noreply at git.blender.org
Mon Mar 12 10:30:15 CET 2018


Commit: f012e1de328b4daf3c26f274366affdb8a0c9d9e
Author: Antonio Vazquez
Date:   Mon Mar 12 10:30:02 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf012e1de328b4daf3c26f274366affdb8a0c9d9e

Remove brush mode panel and add icon

The panel was not needed and was replaced by icons in the main panel.

Notice: I have reused standard icons, but maybe need custom icons in the future, but we will wait to the main redesign 2.8 interface task.

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 17cfa9e9bd2..89de820f00d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2075,9 +2075,12 @@ class VIEW3D_PT_tools_grease_pencil_brush(Panel):
 
         col = row.column()
         sub = col.column(align=True)
+        brush = context.active_gpencil_brush
+        if brush is not None:
+            sub.prop(brush, "gpencil_brush_type", text="")
+
         sub.operator("gpencil.brush_presets_create", icon='HELP', text="")
 
-        brush = context.active_gpencil_brush
         if brush is not None:
             if brush.gpencil_brush_type == 'ERASE':
                 sub.prop(brush, "default_eraser", text="")
@@ -2194,29 +2197,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(Panel):
                 col.prop(brush, "random_subdiv", text="Randomness", slider=True)
 
 
-# Grease Pencil drawing brushes mode
-class VIEW3D_PT_tools_grease_pencil_brush_mode(Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_label = "Brush Mode"
-    bl_category = "Tools"
-    bl_region_type = 'TOOLS'
-    bl_options = {'DEFAULT_CLOSED'}
-
-    @classmethod
-    def poll(cls, context):
-        if context.gpencil_data is None:
-            return False
-
-        gpd = context.gpencil_data
-        return gpd.is_stroke_paint_mode and context.active_gpencil_brush
-
-    @staticmethod
-    def draw(self, context):
-        layout = self.layout
-        brush = context.active_gpencil_brush
-        if brush is not None:
-            layout.prop(brush, "gpencil_brush_type", expand=True)
-
 # Grease Pencil drawingcurves
 class VIEW3D_PT_tools_grease_pencil_brushcurves(Panel):
     bl_space_type = 'VIEW_3D'
@@ -2571,7 +2551,6 @@ classes = (
     VIEW3D_PT_tools_add_object,
     VIEW3D_PT_tools_grease_pencil_brush,
     VIEW3D_PT_tools_grease_pencil_brush_option,
-    VIEW3D_PT_tools_grease_pencil_brush_mode,
     VIEW3D_PT_tools_grease_pencil_brushcurves,
     VIEW3D_PT_tools_grease_pencil_shapes,
     VIEW3D_PT_tools_grease_pencil_edit,
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index a994dcd8d09..625edb65e81 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -126,15 +126,13 @@ const EnumPropertyItem rna_enum_brush_image_tool_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
-/* TODO: duplicated from rna_scene.c (keep this copy after cleanup) */
 static EnumPropertyItem rna_enum_gpencil_brush_types_items[] = {
-	{ GP_BRUSH_TYPE_DRAW, "DRAW", 0, "Draw", "The brush is of type used for drawing strokes" },
-	{ GP_BRUSH_TYPE_FILL, "FILL", 0, "Fill", "The brush is of type used for filling areas" },
-	{ GP_BRUSH_TYPE_ERASE, "ERASE", 0, "Erase", "The brush is used for erasing strokes" },
+	{ GP_BRUSH_TYPE_DRAW, "DRAW", ICON_GREASEPENCIL, "", "The brush is of type used for drawing strokes" },
+	{ GP_BRUSH_TYPE_FILL, "FILL", ICON_COLOR, "", "The brush is of type used for filling areas" },
+	{ GP_BRUSH_TYPE_ERASE, "ERASE", ICON_PANEL_CLOSE, "", "The brush is used for erasing strokes" },
 	{ 0, NULL, 0, NULL, NULL }
 };
 
-/* TODO: duplicated from rna_scene.c (keep this copy after cleanup) */
 static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = {
 	{ GP_BRUSH_ERASER_SOFT, "SOFT", 0, "Soft", "Use soft eraser" },
 	{ GP_BRUSH_ERASER_HARD, "HARD", 0, "Hard", "Use hard eraser" },
@@ -142,7 +140,6 @@ static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = {
 	{ 0, NULL, 0, NULL, NULL }
 };
 
-/* TODO: duplicated from rna_scene.c (keep this copy after cleanup) */
 static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[] = {
 	{ GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits" },
 	{ GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Control", "Use internal control lines as fill boundary limits" },



More information about the Bf-blender-cvs mailing list