[Bf-blender-cvs] [e26bd6e6591] greasepencil-object: GPencil: More UI tweaks to Vertex Color panels

Antonio Vazquez noreply at git.blender.org
Sun Nov 3 20:33:40 CET 2019


Commit: e26bd6e65911b18e1ce54bb088e6ee5a473fb94f
Author: Antonio Vazquez
Date:   Sun Nov 3 20:33:31 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe26bd6e65911b18e1ce54bb088e6ee5a473fb94f

GPencil: More UI tweaks to Vertex Color panels

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

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

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 1e6519f20b4..6baf98a8c1c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -930,13 +930,13 @@ class GreasePencilVertexcolorPanel:
         if ob:
             row = layout.row(align=True)
 
-            row.prop(brush, "color", text="")
-            row = layout.row(align=True)
-            row.template_color_picker(brush, "color", value_slider=True)
+            # row.prop(brush, "color", text="")
+            # row = layout.row(align=True)
+            # row.template_color_picker(brush, "color", value_slider=True)
 
             if brush.gpencil_tool == 'DRAW':
                 row = layout.row(align=True)
-                row.prop(gp_settings, "vertex_color_factor", slider=True, text="Vertex Color Factor")
+                row.prop(gp_settings, "vertex_color_factor", slider=True, text="Mix Factor")
 
             sub_row = layout.row(align=True)
             sub_row.prop(brush, "color", text="")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index f38cb5ff56f..2cd9d6a1574 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -353,6 +353,11 @@ class _draw_tool_settings_context_mode:
                 if gp_style.stroke_style != 'TEXTURE' or gp_style.use_stroke_pattern:
                     row.separator(factor=0.4)
                     row.prop(brush, "color", text="")
+                    row.separator(factor=0.4)
+                    row.popover(
+                        panel="TOPBAR_PT_gpencil_vertexcolor",
+                        text="Vertex Color",
+                    )
 
         row = layout.row(align=True)
         tool_settings = context.scene.tool_settings
@@ -365,6 +370,11 @@ class _draw_tool_settings_context_mode:
         if context.object and brush.gpencil_tool == 'TINT':
             row.separator(factor=0.4)
             row.prop(brush, "color", text="")
+            row.separator(factor=0.4)
+            row.popover(
+                panel="TOPBAR_PT_gpencil_vertexcolor",
+                text="Vertex Color",
+            )
 
         from bl_ui.properties_paint_common import (
             brush_basic_gpencil_paint_settings,
@@ -6750,6 +6760,18 @@ class TOPBAR_PT_gpencil_materials(GreasePencilMaterialsPanel, Panel):
         return ob and ob.type == 'GPENCIL'
 
 
+class TOPBAR_PT_gpencil_vertexcolor(GreasePencilVertexcolorPanel, Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'HEADER'
+    bl_label = "Vertex Color"
+    bl_ui_units_x = 14
+
+    @classmethod
+    def poll(cls, context):
+        ob = context.object
+        return ob and ob.type == 'GPENCIL'
+
+
 classes = (
     VIEW3D_HT_header,
     VIEW3D_HT_tool_header,
@@ -6962,6 +6984,7 @@ classes = (
     VIEW3D_PT_gpencil_draw_context_menu,
     VIEW3D_PT_sculpt_context_menu,
     TOPBAR_PT_gpencil_materials,
+    TOPBAR_PT_gpencil_vertexcolor,
     TOPBAR_PT_annotation_layers,
 )
 
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index c1031cca258..d88c9fbb8b1 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2039,6 +2039,9 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
     def poll(cls, context):
         ob = context.object
         brush = context.tool_settings.gpencil_paint.brush
+        if context.area.type != 'PROPERTIES':
+            return False
+
         if ob is None or brush is None:
             return False
             
@@ -2077,7 +2080,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
 
         if brush.gpencil_tool == 'DRAW':
             row = layout.row(align=True)
-            row.prop(gp_settings, "vertex_color_factor", slider=True, text="Vertex Color Factor")
+            row.prop(gp_settings, "vertex_color_factor", slider=True, text="Mix Factor")
 
         sub_row = layout.row(align=True)
         sub_row.prop(brush, "color", text="")
@@ -2097,6 +2100,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel):
     def poll(cls, context):
         ob = context.object
         brush = context.tool_settings.gpencil_paint.brush
+
         if ob is None or brush is None:
             return False



More information about the Bf-blender-cvs mailing list