Grease Pencil: Tool settings layout adjustments
Small adjustments to improve consistency in tool settings between different tools. Pull Request: https://projects.blender.org/blender/blender/pulls/128491
This commit is contained in:
committed by
Pablo Vazquez
parent
4cefac0da3
commit
177e2ac837
@@ -1433,7 +1433,7 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
|
||||
)
|
||||
|
||||
|
||||
def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props):
|
||||
def brush_basic__draw_color_selector(context, layout, brush, gp_settings):
|
||||
tool_settings = context.scene.tool_settings
|
||||
settings = tool_settings.gpencil_paint
|
||||
ma = gp_settings.material
|
||||
@@ -1474,14 +1474,14 @@ def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
|
||||
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="")
|
||||
show_vertex_color = settings.color_mode == 'VERTEXCOLOR' or gp_settings.brush_draw_mode == 'VERTEXCOLOR'
|
||||
|
||||
if props:
|
||||
row = layout.row(align=True)
|
||||
row.prop(props, "subdivision")
|
||||
if show_vertex_color:
|
||||
sub_row = row.row(align=True)
|
||||
sub_row.enabled = show_vertex_color
|
||||
sub_row.scale_x = 0.8
|
||||
sub_row.prop_with_popover(brush, "color", text="", panel="TOPBAR_PT_gpencil_vertexcolor")
|
||||
row.prop(gp_settings, "pin_draw_mode", text="")
|
||||
|
||||
|
||||
def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
|
||||
@@ -1584,7 +1584,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
|
||||
layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True)
|
||||
|
||||
|
||||
def brush_basic_grease_pencil_paint_settings(layout, context, brush, *, compact=False):
|
||||
def brush_basic_grease_pencil_paint_settings(layout, context, brush, props, *, compact=False):
|
||||
gp_settings = brush.gpencil_settings
|
||||
tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False)
|
||||
if gp_settings is None:
|
||||
@@ -1626,6 +1626,9 @@ def brush_basic_grease_pencil_paint_settings(layout, context, brush, *, compact=
|
||||
col = layout.column()
|
||||
col.template_curve_mapping(gp_settings, "curve_strength", brush=True, use_negative_slope=True)
|
||||
|
||||
if props:
|
||||
layout.prop(props, "subdivision")
|
||||
|
||||
# Brush details
|
||||
if tool.idname in {
|
||||
"builtin.arc",
|
||||
@@ -1683,9 +1686,9 @@ def brush_basic_grease_pencil_paint_settings(layout, context, brush, *, compact=
|
||||
layout.use_property_split = use_property_split_prev
|
||||
elif grease_pencil_tool == 'ERASE':
|
||||
layout.prop(gp_settings, "eraser_mode", expand=True)
|
||||
layout.prop(gp_settings, "use_active_layer_only")
|
||||
if gp_settings.eraser_mode in {'HARD', 'SOFT'}:
|
||||
layout.prop(gp_settings, "use_keep_caps_eraser")
|
||||
layout.prop(gp_settings, "use_active_layer_only")
|
||||
elif grease_pencil_tool == 'TINT':
|
||||
layout.prop(gp_settings, "vertex_mode", text="Mode")
|
||||
layout.popover("VIEW3D_PT_tools_brush_falloff")
|
||||
|
||||
@@ -2175,8 +2175,8 @@ class _defs_grease_pencil_paint:
|
||||
gp_settings = brush.gpencil_settings
|
||||
row = layout.row()
|
||||
row.use_property_split = False
|
||||
row.prop(gp_settings, "use_keep_caps_eraser")
|
||||
row.prop(gp_settings, "use_active_layer_only")
|
||||
row.prop(gp_settings, "use_keep_caps_eraser")
|
||||
|
||||
return dict(
|
||||
idname="builtin.trim",
|
||||
@@ -2206,8 +2206,8 @@ class _defs_grease_pencil_paint:
|
||||
brush_basic__draw_color_selector,
|
||||
)
|
||||
|
||||
brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
|
||||
brush_basic_grease_pencil_paint_settings(layout, context, brush, compact=True)
|
||||
brush_basic__draw_color_selector(context, layout, brush, gp_settings)
|
||||
brush_basic_grease_pencil_paint_settings(layout, context, brush, props, compact=True)
|
||||
return True
|
||||
|
||||
@ToolDef.from_fn
|
||||
@@ -2329,10 +2329,10 @@ class _defs_grease_pencil_paint:
|
||||
def draw_settings(_context, layout, tool):
|
||||
props = tool.operator_properties("grease_pencil.interpolate")
|
||||
layout.prop(props, "layers")
|
||||
layout.prop(props, "exclude_breakdowns")
|
||||
layout.prop(props, "flip")
|
||||
layout.prop(props, "smooth_factor")
|
||||
layout.prop(props, "smooth_steps")
|
||||
layout.prop(props, "exclude_breakdowns")
|
||||
|
||||
return dict(
|
||||
idname="builtin.interpolate",
|
||||
@@ -2690,7 +2690,7 @@ class _defs_gpencil_paint:
|
||||
brush_basic__draw_color_selector,
|
||||
)
|
||||
|
||||
brush_basic__draw_color_selector(context, layout, brush, gp_settings, props)
|
||||
brush_basic__draw_color_selector(context, layout, brush, gp_settings)
|
||||
brush_basic_gpencil_paint_settings(layout, context, brush, compact=True)
|
||||
return True
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ class _draw_tool_settings_context_mode:
|
||||
from bl_ui.properties_paint_common import (
|
||||
brush_basic__draw_color_selector,
|
||||
)
|
||||
brush_basic__draw_color_selector(context, layout, brush, gp_settings, None)
|
||||
brush_basic__draw_color_selector(context, layout, brush, gp_settings)
|
||||
|
||||
if ob and brush.gpencil_tool == 'TINT':
|
||||
row.separator(factor=0.4)
|
||||
@@ -780,7 +780,7 @@ class _draw_tool_settings_context_mode:
|
||||
from bl_ui.properties_paint_common import (
|
||||
brush_basic__draw_color_selector,
|
||||
)
|
||||
brush_basic__draw_color_selector(context, layout, brush, brush.gpencil_settings, None)
|
||||
brush_basic__draw_color_selector(context, layout, brush, brush.gpencil_settings)
|
||||
|
||||
if grease_pencil_tool == 'TINT':
|
||||
row.separator(factor=0.4)
|
||||
@@ -790,7 +790,7 @@ class _draw_tool_settings_context_mode:
|
||||
brush_basic_grease_pencil_paint_settings,
|
||||
)
|
||||
|
||||
brush_basic_grease_pencil_paint_settings(layout, context, brush, compact=True)
|
||||
brush_basic_grease_pencil_paint_settings(layout, context, brush, None, compact=True)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@@ -2497,7 +2497,7 @@ class VIEW3D_PT_tools_grease_pencil_v3_brush_settings(Panel, View3DPanel, Grease
|
||||
from bl_ui.properties_paint_common import (
|
||||
brush_basic_grease_pencil_paint_settings,
|
||||
)
|
||||
brush_basic_grease_pencil_paint_settings(layout, context, brush, compact=False)
|
||||
brush_basic_grease_pencil_paint_settings(layout, context, brush, None, compact=False)
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_grease_pencil_v3_brush_advanced(View3DPanel, Panel):
|
||||
|
||||
@@ -2004,7 +2004,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "use_keep_caps_eraser", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "flag", GP_BRUSH_ERASER_KEEP_CAPS);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Keep caps", "Keep the caps as they are and don't flatten them when erasing");
|
||||
prop, "Keep Caps", "Keep the caps as they are and don't flatten them when erasing");
|
||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
||||
|
||||
prop = RNA_def_property(srna, "use_active_layer_only", PROP_BOOLEAN, PROP_NONE);
|
||||
|
||||
Reference in New Issue
Block a user