[Bf-blender-cvs] [e9299685115] greasepencil-object: GPencil: Fix more damaged panels
Antonio Vazquez
noreply at git.blender.org
Mon Dec 16 10:53:03 CET 2019
Commit: e92996851154db33c5dc2954ab774954a3b54d85
Author: Antonio Vazquez
Date: Mon Dec 16 10:43:06 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe92996851154db33c5dc2954ab774954a3b54d85
GPencil: Fix more damaged panels
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/space_view3d.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 a74ac7e616d..33b042f1d2c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -839,7 +839,16 @@ class GreasePencilFlipTintColors(Operator):
def execute(self, context):
try:
ts = context.tool_settings
- settings = ts.gpencil_paint
+ settings = None
+ if context.mode == 'PAINT_GPENCIL':
+ settings = ts.gpencil_paint
+ if context.mode == 'SCULPT_GPENCIL':
+ settings = ts.gpencil_sculpt_paint
+ elif context.mode == 'WEIGHT_GPENCIL':
+ settings = ts.gpencil_weight_paint
+ elif context.mode == 'VERTEX_GPENCIL':
+ settings = ts.gpencil_vertex_paint
+
brush = settings.brush
if brush is not None:
color = brush.color
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index af7cb84e1c2..8d903330474 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6748,6 +6748,40 @@ class VIEW3D_PT_gpencil_draw_context_menu(Panel):
layout.operator("gpencil.active_frames_delete_all", text="Delete All Layers", icon='REMOVE')
+class VIEW3D_PT_gpencil_vertex_context_menu(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'WINDOW'
+ bl_label = "Vertex Paint Context Menu"
+
+ def draw(self, context):
+ layout = self.layout
+ ts = context.tool_settings
+ settings = ts.gpencil_vertex_paint
+ brush = settings.brush
+ gp_settings = brush.gpencil_settings
+
+ col = layout.column()
+
+ if brush.gpencil_vertex_tool in {'DRAW', 'REPLACE'}:
+ split = layout.split(factor=0.1)
+ split.prop(brush, "color", text="")
+ split.template_color_picker(brush, "color", value_slider=True)
+
+ col = layout.column()
+ col.separator()
+ col.prop_menu_enum(gp_settings, "vertex_mode", text="Mode")
+ col.separator()
+
+ row = col.row(align=True)
+ row.prop(brush, "size", text="Radius")
+ row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+
+ if brush.gpencil_vertex_tool in {'DRAW', 'BLUR', 'SMEAR'}:
+ row = layout.row(align=True)
+ row.prop(gp_settings, "pen_strength", slider=True)
+ row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
+
+
class VIEW3D_PT_paint_vertex_context_menu(Panel):
# Only for popover, these are dummy values.
bl_space_type = 'VIEW_3D'
@@ -7074,6 +7108,7 @@ classes = (
VIEW3D_PT_paint_vertex_context_menu,
VIEW3D_PT_paint_texture_context_menu,
VIEW3D_PT_paint_weight_context_menu,
+ VIEW3D_PT_gpencil_vertex_context_menu,
VIEW3D_PT_gpencil_sculpt_context_menu,
VIEW3D_PT_gpencil_draw_context_menu,
VIEW3D_PT_sculpt_context_menu,
More information about the Bf-blender-cvs
mailing list