[Bf-blender-cvs] [356ffdcc061] greasepencil-object: GPencil: New context menu for Vertex Mode
Antonio Vazquez
noreply at git.blender.org
Mon Nov 11 19:56:41 CET 2019
Commit: 356ffdcc061c7844180b030368cdcdf38075bac4
Author: Antonio Vazquez
Date: Mon Nov 11 19:05:33 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB356ffdcc061c7844180b030368cdcdf38075bac4
GPencil: New context menu for Vertex Mode
===================================================================
M release/scripts/presets/keyconfig/keymap_data/blender_default.py
M release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M release/scripts/startup/bl_ui/space_view3d.py
===================================================================
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 7916c870c5d..81027053a60 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3362,6 +3362,8 @@ def km_grease_pencil_stroke_vertex_mode(params):
op_tool("builtin_brush.Blur", {"type": 'F', "value": 'PRESS'}),
op_tool("builtin_brush.Average", {"type": 'E', "value": 'PRESS'}),
op_tool("builtin.brush.Smear", {"type": 'K', "value": 'PRESS'}),
+ # Vertex Paint context menu
+ op_panel("VIEW3D_PT_gpencil_vertex_context_menu", params.context_menu_event),
])
return keymap
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 8d8faa829f7..f9fb0d6d610 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2567,6 +2567,8 @@ def km_grease_pencil_stroke_vertex_mode(params):
op_tool("builtin_brush.Average", {"type": 'E', "value": 'PRESS'}),
op_tool("builtin.brush.Smear", {"type": 'K', "value": 'PRESS'}),
op_tool("builtin.brush.Replace", {"type": 'R', "value": 'PRESS'}),
+ # Vertex Paint context menu
+ op_panel("VIEW3D_PT_gpencil_vertex_context_menu", params.context_menu_event),
])
return keymap
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index f9d07f397ae..930306a0fad 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6694,6 +6694,42 @@ 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'):
+ col.prop(gp_settings, "vertex_mode", text="Mode")
+
+ col.template_color_picker(brush, "color", value_slider=True)
+
+ sub_row = col.row(align=True)
+ sub_row.prop(brush, "color", text="")
+ sub_row.prop(brush, "secondary_color", text="")
+ sub_row.operator("gpencil.tint_flip", icon='FILE_REFRESH', text="")
+
+ 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'
@@ -7021,6 +7057,7 @@ classes = (
VIEW3D_PT_paint_weight_context_menu,
VIEW3D_PT_gpencil_sculpt_context_menu,
VIEW3D_PT_gpencil_draw_context_menu,
+ VIEW3D_PT_gpencil_vertex_context_menu,
VIEW3D_PT_sculpt_context_menu,
TOPBAR_PT_gpencil_materials,
TOPBAR_PT_gpencil_vertexcolor,
More information about the Bf-blender-cvs
mailing list