[Bf-blender-cvs] [989be48d838] greasepencil-object: GPencil: Fix missing Weight Paint context menu
Antonio Vazquez
noreply at git.blender.org
Sat Feb 29 11:23:10 CET 2020
Commit: 989be48d8381d8652e5c19fa78a2c02e3f59b01c
Author: Antonio Vazquez
Date: Sat Feb 29 11:21:26 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB989be48d8381d8652e5c19fa78a2c02e3f59b01c
GPencil: Fix missing Weight Paint context menu
===================================================================
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 be782c12581..4761a4c81f5 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3567,6 +3567,8 @@ def km_grease_pencil_stroke_weight_mode(params):
{"properties": [("data_path_primary", 'tool_settings.gpencil_weight_paint.brush.size')]}),
# Display
*_grease_pencil_display(),
+ # Context menu
+ *_template_items_context_panel("VIEW3D_PT_gpencil_weight_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 8a83a9e5c32..e634ec755ce 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2714,7 +2714,7 @@ def km_grease_pencil_stroke_weight_mode(params):
("wm.radial_control", {"type": 'S', "value": 'PRESS'},
{"properties": [("data_path_primary", 'tool_settings.gpencil_sculpt.brush.size')]}),
# Context menu
- *_template_items_context_panel("VIEW3D_PT_gpencil_sculpt_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
+ *_template_items_context_panel("VIEW3D_PT_gpencil_weight_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}),
])
return keymap
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 420fcb584c3..844412c854e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6833,8 +6833,6 @@ class VIEW3D_PT_gpencil_sculpt_context_menu(Panel):
layout = self.layout
- if context.mode == 'WEIGHT_GPENCIL':
- layout.prop(brush, "weight")
layout.prop(brush, "size", slider=True)
layout.prop(brush, "strength")
@@ -6859,6 +6857,23 @@ class VIEW3D_PT_gpencil_sculpt_context_menu(Panel):
layout.operator("gpencil.active_frames_delete_all", text="Delete All Layers", icon='REMOVE')
+class VIEW3D_PT_gpencil_weight_context_menu(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'WINDOW'
+ bl_label = "Weight Paint Context Menu"
+
+ def draw(self, context):
+ ts = context.tool_settings
+ settings = ts.gpencil_paint
+ brush = settings.brush
+
+ layout = self.layout
+
+ layout.prop(brush, "size", slider=True)
+ layout.prop(brush, "strength")
+ layout.prop(brush, "weight")
+
+
class VIEW3D_PT_gpencil_draw_context_menu(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'WINDOW'
@@ -7359,6 +7374,7 @@ classes = (
VIEW3D_PT_paint_weight_context_menu,
VIEW3D_PT_gpencil_vertex_context_menu,
VIEW3D_PT_gpencil_sculpt_context_menu,
+ VIEW3D_PT_gpencil_weight_context_menu,
VIEW3D_PT_gpencil_draw_context_menu,
VIEW3D_PT_sculpt_context_menu,
TOPBAR_PT_gpencil_materials,
More information about the Bf-blender-cvs
mailing list