diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-13 12:59:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-13 12:59:25 +0300 |
commit | f4d4f502122aaf7df65cc8d3beeb86a9f444712b (patch) | |
tree | d0324506741620fccf3366090511f83dadd546b9 | |
parent | 4503c96a175596bf5c0a52508a162dd78bcb9cdc (diff) |
UI: move gpencil paint into topbar only layout
Tool properties were duplicating UI elements.
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 32 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 33 |
2 files changed, 33 insertions, 32 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 3fa27bd4d26..cea897ae8e9 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1384,22 +1384,6 @@ class _defs_gpencil_edit: class _defs_gpencil_sculpt: - def draw_settings_common(context, layout, tool): - tool_settings = context.tool_settings - settings = tool_settings.gpencil_sculpt - tool = settings.sculpt_tool - brush = settings.brush - - layout.prop(brush, "size", slider=True) - - row = layout.row(align=True) - row.prop(brush, "strength", slider=True) - row.prop(brush, "use_pressure_strength", text="") - - if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}: - row.separator() - row.prop(brush, "direction", expand=True, text="") - @staticmethod def generate_from_brushes(context): return generate_from_enum_ex( @@ -1407,24 +1391,11 @@ class _defs_gpencil_sculpt: icon_prefix="ops.gpencil.sculpt_", type=bpy.types.GPencilSculptSettings, attr="sculpt_tool", - tooldef_keywords={ - "draw_settings": _defs_gpencil_sculpt.draw_settings_common, - }, ) class _defs_gpencil_weight: - def draw_settings_common(context, layout, tool): - settings = context.tool_settings.gpencil_sculpt - brush = settings.brush - - layout.prop(brush, "size", slider=True) - - row = layout.row(align=True) - row.prop(brush, "strength", slider=True) - row.prop(brush, "use_pressure_strength", text="") - @staticmethod def generate_from_brushes(context): return generate_from_enum_ex( @@ -1432,9 +1403,6 @@ class _defs_gpencil_weight: icon_prefix="ops.gpencil.sculpt_", type=bpy.types.GPencilSculptSettings, attr="weight_tool", - tooldef_keywords={ - "draw_settings": _defs_gpencil_weight.draw_settings_common, - }, ) diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index ac6bd4002ca..5d2e98bdd8a 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -369,6 +369,39 @@ class _draw_left_context_mode: draw_color_selector() @staticmethod + def GPENCIL_SCULPT(context, layout, tool): + if (tool is None) or (not tool.has_datablock): + return + tool_settings = context.tool_settings + settings = tool_settings.gpencil_sculpt + tool = settings.sculpt_tool + brush = settings.brush + + layout.prop(brush, "size", slider=True) + + row = layout.row(align=True) + row.prop(brush, "strength", slider=True) + row.prop(brush, "use_pressure_strength", text="") + + if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}: + row.separator() + row.prop(brush, "direction", expand=True, text="") + + @staticmethod + def GPENCIL_WEIGHT(context, layout, tool): + if (tool is None) or (not tool.has_datablock): + return + tool_settings = context.tool_settings + settings = tool_settings.gpencil_sculpt + brush = settings.brush + + layout.prop(brush, "size", slider=True) + + row = layout.row(align=True) + row.prop(brush, "strength", slider=True) + row.prop(brush, "use_pressure_strength", text="") + + @staticmethod def PARTICLE(context, layout, tool): # See: 'VIEW3D_PT_tools_brush', basically a duplicate settings = context.tool_settings.particle_edit |