[Bf-blender-cvs] [fedb278d314] greasepencil-object: GP: Fill: Temp fix for fill options in topbar
Charlie Jolly
noreply at git.blender.org
Fri Jan 18 10:23:02 CET 2019
Commit: fedb278d3147a5cc55ef9ca108894be877639e7b
Author: Charlie Jolly
Date: Fri Jan 18 09:22:31 2019 +0000
Branches: greasepencil-object
https://developer.blender.org/rBfedb278d3147a5cc55ef9ca108894be877639e7b
GP: Fill: Temp fix for fill options in topbar
Topbar has a bug that means if there are too many items it won't display them.
This temp fix moves some of the Fill tool options to a popup panel.
===================================================================
M release/scripts/startup/bl_ui/properties_paint_common.py
M release/scripts/startup/bl_ui/space_topbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index cc608197882..f2f4c1f37db 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
@@ -415,24 +415,12 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
row = layout.row(align=True)
row.prop(gp_settings, "fill_leak", text="Leak Size")
row = layout.row(align=True)
- row.prop(gp_settings, "fill_factor", text="Resolution")
- row = layout.row(align=True)
- row.prop(gp_settings, "fill_dilate", text="Dilate")
- row = layout.row(align=True)
row.prop(brush, "size", text="Thickness")
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="Mode")
row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID')
-
- if gp_settings.fill_draw_mode != 'STROKE':
- row = layout.row(align=True)
- row.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes")
- row.separator()
- 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")
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index d27f8e303c9..71be2da2c4a 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -367,6 +367,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,30 @@ 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_dilate", text="Dilate")
+ 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 +1091,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.
More information about the Bf-blender-cvs
mailing list