Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-09-22 21:11:02 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-09-22 21:11:28 +0300
commit88970e3900f32d43cadd0f3b6809e71771612379 (patch)
tree50533757968c7cfd4b9c1bbb2bafcd2ed3fd2ff2 /release/scripts/startup/bl_ui/properties_paint_common.py
parentdab50ad7183458aa5ad5b982097da844397be3d9 (diff)
GPencil: Improve default brush draw mode
Mainly a UI adjustment, no functional changes To have the default mode in the advanced panel as separated option is not the best solution. Now, there is a pin option and when it is enabled, the brush keeps this mode. Differential Revision: https://developer.blender.org/D8974
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_paint_common.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index d5f48876491..135ba802655 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -1148,11 +1148,19 @@ def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
if brush.gpencil_tool in {'DRAW', 'FILL'}:
row.separator(factor=1.0)
- row.prop_enum(settings, "color_mode", 'MATERIAL', text="", icon='MATERIAL')
- row.prop_enum(settings, "color_mode", 'VERTEXCOLOR', text="", icon='VPAINT_HLT')
sub_row = row.row(align=True)
- sub_row.enabled = settings.color_mode == 'VERTEXCOLOR'
+ sub_row.enabled = not gp_settings.pin_draw_mode
+ if gp_settings.pin_draw_mode:
+ sub_row.prop_enum(gp_settings, "brush_draw_mode", 'MATERIAL', text="", icon='MATERIAL')
+ sub_row.prop_enum(gp_settings, "brush_draw_mode", 'VERTEXCOLOR', text="", icon='VPAINT_HLT')
+ else:
+ sub_row.prop_enum(settings, "color_mode", 'MATERIAL', text="", icon='MATERIAL')
+ sub_row.prop_enum(settings, "color_mode", 'VERTEXCOLOR', text="", icon='VPAINT_HLT')
+
+ sub_row = row.row(align=True)
+ sub_row.enabled = settings.color_mode == 'VERTEXCOLOR' or gp_settings.brush_draw_mode == 'VERTEXCOLOR'
sub_row.prop_with_popover(brush, "color", text="", panel="TOPBAR_PT_gpencil_vertexcolor")
+ row.prop(gp_settings, "pin_draw_mode", text="")
if props:
row = layout.row(align=True)