diff options
author | Antonioya <blendergit@gmail.com> | 2019-03-17 21:47:31 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-03-17 21:47:56 +0300 |
commit | 6577618d5bb93792c805e0c22e4de1a015ee25d5 (patch) | |
tree | 05d5056646b3aefd8be21bb1ff314e4373865683 /release | |
parent | 887d052e56a515145f4dd7433e49c91c5d149169 (diff) |
GPencil: Changes in Fill and new 3D Cursor View Plane
This commit groups several options that were tested in grease pencil branch:
- Changes to fill algorithms and improves, specially in small areas and stroke corners.
New options has been added in order to define how the fill is working and internally there are optimizations in detect the small areas in the extremes.
Kudos to @charlie for coding this fill improvements.
- New 3D cursor view plane option.
Now it's possible to lock the drawing plane to the 3D cursor and use the 3D cursor orientation. This allows more flexibility when you are drawing and reduce the need to create geometry to draw over surfaces.
- Canvas Grid now can be locked to 3D cursor.
- New option to reproject stroke using 3D cursor.
- Small tweaks and fixes.
Changes reviewed by @pepeland and @mendio
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 19 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 32 |
2 files changed, 37 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 1a1f0fa3fb7..ac63948d18a 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -393,7 +393,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=False): +def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=True): gp_settings = brush.gpencil_settings # Brush details @@ -412,24 +412,15 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False) row = layout.row(align=True) row.prop(gp_settings, "eraser_thickness_factor") elif brush.gpencil_tool == 'FILL': - row = layout.column(align=True) + row = layout.row(align=True) row.prop(gp_settings, "fill_leak", text="Leak Size") - row.separator() - row = layout.column(align=True) + row = layout.row(align=True) row.prop(brush, "size", text="Thickness") - row = layout.column(align=True) + row = layout.row(align=True) row.prop(gp_settings, "fill_simplify_level", text="Simplify") - row = layout.row(align=True) - row.prop(gp_settings, "fill_draw_mode", text="Boundary Draw Mode") + row.prop(gp_settings, "fill_draw_mode", text="Boundary") row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID') - - row = layout.column(align=True) - row.enabled = gp_settings.fill_draw_mode != 'STROKE' - row.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes") - sub = layout.row(align=True) - sub.enabled = not gp_settings.show_fill - sub.prop(gp_settings, "fill_threshold", text="Threshold") else: # brush.gpencil_tool == 'DRAW': row = layout.row(align=True) row.prop(brush, "size", text="Radius") diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 4cda2678e33..73aa59a2693 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -362,6 +362,15 @@ class _draw_left_context_mode: 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" + ) @staticmethod def SCULPT_GPENCIL(context, layout, tool): @@ -1036,6 +1045,28 @@ class TOPBAR_PT_gpencil_primitive(Panel): # Curve layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True) +# Grease Pencil Fill +class TOPBAR_PT_gpencil_fill(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Advanced" + + @staticmethod + def draw(self, context): + paint = context.tool_settings.gpencil_paint + brush = paint.brush + gp_settings = brush.gpencil_settings + + layout = self.layout + # Fill + 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") + classes = ( TOPBAR_HT_upper_bar, @@ -1058,6 +1089,7 @@ classes = ( TOPBAR_PT_active_tool, TOPBAR_PT_gpencil_layers, TOPBAR_PT_gpencil_primitive, + TOPBAR_PT_gpencil_fill, ) if __name__ == "__main__": # only for live edit. |