diff options
author | Charlie Jolly <mistajolly@gmail.com> | 2019-10-11 14:26:57 +0300 |
---|---|---|
committer | Charlie Jolly <mistajolly@gmail.com> | 2019-10-11 14:26:57 +0300 |
commit | 7d3ea8f12ba89ef7b87a99b8cde0f14fdab7eb2b (patch) | |
tree | ec21402661fd032df73154dbc8255736bb4c1b9a /release/scripts | |
parent | 67b1a15b3f4dfccf1e2118f21158e14774cd071a (diff) |
Fix T69964: GPencil: Fill options are not shown on a properties editor
Differential Revision: https://developer.blender.org/D6041
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 38 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 23 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 3 |
3 files changed, 40 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 23b2556eddb..c201ccbe7f8 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -367,7 +367,7 @@ def brush_basic_sculpt_settings(layout, context, brush, *, compact=False): layout.row().prop(brush, "direction", expand=True, **({"text": ""} if compact else {})) -def brush_basic_gpencil_paint_settings(layout, _context, brush, *, compact=True): +def brush_basic_gpencil_paint_settings(layout, _context, brush, tool, *, compact=True, is_toolbar=False): gp_settings = brush.gpencil_settings # Brush details @@ -395,6 +395,23 @@ def brush_basic_gpencil_paint_settings(layout, _context, brush, *, compact=True) row = layout.row(align=True) row.prop(gp_settings, "fill_draw_mode", text="Boundary") row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID') + # Fill options + if is_toolbar: + settings = _context.tool_settings.gpencil_sculpt + row = layout.row(align=True) + sub = row.row(align=True) + sub.popover( + panel="TOPBAR_PT_gpencil_fill", + text="Fill Options", + ) + else: + row = layout.row(align=True) + row.prop(gp_settings, "fill_factor", text="Resolution") + if gp_settings.fill_draw_mode != 'STROKE': + row = layout.row(align=True) + row.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes") + row = layout.row(align=True) + row.prop(gp_settings, "fill_threshold", text="Threshold") else: # brush.gpencil_tool == 'DRAW': row = layout.row(align=True) row.prop(brush, "size", text="Radius") @@ -402,6 +419,25 @@ def brush_basic_gpencil_paint_settings(layout, _context, brush, *, compact=True) row = layout.row(align=True) row.prop(gp_settings, "pen_strength", slider=True) row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE') + + if tool.idname in {"builtin.arc", "builtin.curve", "builtin.line", "builtin.box", "builtin.circle"}: + settings = _context.tool_settings.gpencil_sculpt + if is_toolbar: + row = layout.row(align=True) + row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA') + sub = row.row(align=True) + sub.active = settings.use_thickness_curve + sub.popover( + panel="TOPBAR_PT_gpencil_primitive", + text="Thickness Profile", + ) + else: + row = layout.row(align=True) + row.prop(settings, "use_thickness_curve", text="Use Thickness Profile") + sub = row.row(align=True) + if settings.use_thickness_curve: + # Curve + layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True) def brush_basic_gpencil_sculpt_settings(layout, context, brush, *, compact=False): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 7d13c9c4112..5ad1dec9480 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -351,28 +351,7 @@ class _draw_tool_settings_context_mode: from bl_ui.properties_paint_common import ( brush_basic_gpencil_paint_settings, ) - brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) - - # FIXME: tools must use their own UI drawing! - if tool.idname in {"builtin.arc", "builtin.curve", "builtin.line", "builtin.box", "builtin.circle"}: - settings = context.tool_settings.gpencil_sculpt - row = layout.row(align=True) - row.prop(settings, "use_thickness_curve", text="", icon='CURVE_DATA') - sub = row.row(align=True) - sub.active = settings.use_thickness_curve - sub.popover( - panel="TOPBAR_PT_gpencil_primitive", - text="Thickness Profile", - ) - - if brush.gpencil_tool == 'FILL': - settings = context.tool_settings.gpencil_sculpt - row = layout.row(align=True) - sub = row.row(align=True) - sub.popover( - panel="TOPBAR_PT_gpencil_fill", - text="Fill Options", - ) + brush_basic_gpencil_paint_settings(layout, context, brush, tool, compact=True, is_toolbar=True) @staticmethod def SCULPT_GPENCIL(context, layout, tool): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 3aee14e0239..8da5ba67187 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1873,7 +1873,8 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): from bl_ui.properties_paint_common import ( brush_basic_gpencil_paint_settings, ) - brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) + tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False) + brush_basic_gpencil_paint_settings(layout, context, brush, tool, compact=True, is_toolbar=False) # Grease Pencil drawing brushes options |