diff options
author | Falk David <falkdavid@gmx.de> | 2020-08-14 16:07:07 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2020-08-14 16:07:07 +0300 |
commit | b221d8d0a32a74d912cc0fa204565410eee95dcf (patch) | |
tree | 61f46d393ead7a2a492d40b3b958e105d9b1d8c1 /release/scripts/startup | |
parent | a0152042b846887412c31df8ad4f779a2c400c1c (diff) | |
parent | 735c717a63c8870d2ef4a910d82a2648cbaaa5e1 (diff) |
Merge branch 'greasepencil-edit-curve' into soc-2020-greasepencil-curve
Diffstat (limited to 'release/scripts/startup')
6 files changed, 120 insertions, 50 deletions
diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py index e92f493960a..ceef2df63ff 100644 --- a/release/scripts/startup/bl_operators/userpref.py +++ b/release/scripts/startup/bl_operators/userpref.py @@ -354,7 +354,7 @@ class PREFERENCES_OT_keyitem_restore(Operator): item_id: IntProperty( name="Item Identifier", - description="Identifier of the item to remove", + description="Identifier of the item to restore", ) @classmethod diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 77308fed014..7ff2688f2a7 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -350,7 +350,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel): if enable_edit or (ob.use_shape_key_edit_mode and ob.type == 'MESH'): enable_pin = True - if ob.show_only_shape_key: + if ob.show_only_shape_key is False: enable_edit_value = True row = layout.row() diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index f1004358418..6a541863aef 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -722,6 +722,8 @@ def brush_settings(layout, context, brush, popover=False): elif sculpt_tool == 'BOUNDARY': col = layout.column() col.prop(brush, "boundary_deform_type") + col.prop(brush, "boundary_falloff_type") + col.prop(brush, "boundary_offset") elif sculpt_tool == 'TOPOLOGY': col = layout.column() @@ -1109,6 +1111,45 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False): header=True ) +def brush_basic__draw_color_selector(context, layout, brush, gp_settings, props): + tool_settings = context.scene.tool_settings + settings = tool_settings.gpencil_paint + ma = gp_settings.material + + row = layout.row(align=True) + if not gp_settings.use_material_pin: + ma = context.object.active_material + icon_id = 0 + if ma: + icon_id = ma.id_data.preview.icon_id + txt_ma = ma.name + maxw = 25 + if len(txt_ma) > maxw: + txt_ma = txt_ma[:maxw - 5] + '..' + txt_ma[-3:] + else: + txt_ma = "" + + sub = row.row() + sub.ui_units_x = 8 + sub.popover( + panel="TOPBAR_PT_gpencil_materials", + text=txt_ma, + icon_value=icon_id, + ) + + row.prop(gp_settings, "use_material_pin", text="") + + if brush.gpencil_tool in {'DRAW', 'FILL'}: + row.separator(factor=1.0) + row.prop_enum(settings, "color_mode", 'MATERIAL', text="", icon='MATERIAL') + row.prop_enum(settings, "color_mode", 'VERTEXCOLOR', text="", icon='VPAINT_HLT') + sub_row = row.row(align=True) + sub_row.enabled = settings.color_mode == 'VERTEXCOLOR' + sub_row.prop_with_popover(brush, "color", text="", panel="TOPBAR_PT_gpencil_vertexcolor") + + if props: + row = layout.row(align=True) + row.prop(props, "subdivision") def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False): tool_settings = context.tool_settings diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 9f251a9abad..19c1c2e02c4 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -327,6 +327,7 @@ class SEQUENCER_MT_view(Menu): if is_preview: layout.separator() if st.display_mode == 'IMAGE': + layout.prop(st, "zoom_to_fit") layout.prop(ed, "show_overlay", text="Show Frame Overlay") layout.prop(st, "show_safe_areas", text="Show Safe Areas") layout.prop(st, "show_metadata", text="Show Metadata") diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index d07241203fb..38879d41a64 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1335,6 +1335,22 @@ class _defs_sculpt: draw_settings=draw_settings, ) + @ToolDef.from_fn + def face_set_edit(): + def draw_settings(_context, layout, tool): + props = tool.operator_properties("sculpt.face_set_edit") + layout.prop(props, "mode", expand=False) + layout.prop(props, "modify_hidden") + + return dict( + idname="builtin.face_set_edit", + label="Edit Face Set", + icon="ops.sculpt.face_set_edit", + widget=None, + keymap="3D View Tool: Sculpt, Face Set Edit", + draw_settings=draw_settings, + ) + class _defs_vertex_paint: @@ -1671,6 +1687,29 @@ class _defs_image_uv_sculpt: class _defs_gpencil_paint: @staticmethod + def gpencil_primitive_toolbar(context, layout, tool, props): + paint = context.tool_settings.gpencil_paint + brush = paint.brush + + if brush is None: + return False + + gp_settings = brush.gpencil_settings + + row = layout.row(align=True) + tool_settings = context.scene.tool_settings + settings = tool_settings.gpencil_paint + row.template_ID_preview(settings, "brush", rows=3, cols=8, hide_buttons=True) + + from bl_ui.properties_paint_common import ( + brush_basic_gpencil_paint_settings, + brush_basic__draw_color_selector, + ) + + brush_basic__draw_color_selector(context, layout, brush, gp_settings, props) + brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) + + @staticmethod def generate_from_brushes(context): return generate_from_enum_ex( context, @@ -1697,6 +1736,10 @@ class _defs_gpencil_paint: @ToolDef.from_fn def line(): + def draw_settings(context, layout, tool): + props = tool.operator_properties("gpencil.primitive_line") + _defs_gpencil_paint.gpencil_primitive_toolbar(context, layout, tool, props) + return dict( idname="builtin.line", label="Line", @@ -1704,10 +1747,15 @@ class _defs_gpencil_paint: cursor='CROSSHAIR', widget=None, keymap=(), + draw_settings=draw_settings, ) @ToolDef.from_fn def polyline(): + def draw_settings(context, layout, tool): + props = tool.operator_properties("gpencil.primitive_polyline") + _defs_gpencil_paint.gpencil_primitive_toolbar(context, layout, tool, props) + return dict( idname="builtin.polyline", label="Polyline", @@ -1715,10 +1763,15 @@ class _defs_gpencil_paint: cursor='CROSSHAIR', widget=None, keymap=(), + draw_settings=draw_settings, ) @ToolDef.from_fn def box(): + def draw_settings(context, layout, tool): + props = tool.operator_properties("gpencil.primitive_box") + _defs_gpencil_paint.gpencil_primitive_toolbar(context, layout, tool, props) + return dict( idname="builtin.box", label="Box", @@ -1726,10 +1779,15 @@ class _defs_gpencil_paint: cursor='CROSSHAIR', widget=None, keymap=(), + draw_settings=draw_settings, ) @ToolDef.from_fn def circle(): + def draw_settings(context, layout, tool): + props = tool.operator_properties("gpencil.primitive_circle") + _defs_gpencil_paint.gpencil_primitive_toolbar(context, layout, tool, props) + return dict( idname="builtin.circle", label="Circle", @@ -1737,10 +1795,15 @@ class _defs_gpencil_paint: cursor='CROSSHAIR', widget=None, keymap=(), + draw_settings=draw_settings, ) @ToolDef.from_fn def arc(): + def draw_settings(context, layout, tool): + props = tool.operator_properties("gpencil.primitive_curve") + _defs_gpencil_paint.gpencil_primitive_toolbar(context, layout, tool, props) + return dict( idname="builtin.arc", label="Arc", @@ -1748,10 +1811,15 @@ class _defs_gpencil_paint: cursor='CROSSHAIR', widget=None, keymap=(), + draw_settings=draw_settings, ) @ToolDef.from_fn def curve(): + def draw_settings(context, layout, tool): + props = tool.operator_properties("gpencil.primitive_curve") + _defs_gpencil_paint.gpencil_primitive_toolbar(context, layout, tool, props) + return dict( idname="builtin.curve", label="Curve", @@ -1759,6 +1827,7 @@ class _defs_gpencil_paint: cursor='CROSSHAIR', widget=None, keymap=(), + draw_settings=draw_settings, ) @ToolDef.from_fn @@ -2542,6 +2611,8 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): else () ), None, + _defs_sculpt.face_set_edit, + None, _defs_transform.translate, _defs_transform.rotate, _defs_transform.scale, diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 0c4680ea6ba..72f0128965c 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -385,19 +385,7 @@ class _draw_tool_settings_context_mode: if tool is None: return False - # is_paint = True - # FIXME: tools must use their own UI drawing! - if tool.idname in { - "builtin.line", - "builtin.box", - "builtin.circle", - "builtin.arc", - "builtin.curve", - "builtin.polyline", - }: - # is_paint = False - pass - elif tool.idname == "builtin.cutter": + if tool.idname == "builtin.cutter": row = layout.row(align=True) row.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold") return False @@ -411,47 +399,16 @@ class _draw_tool_settings_context_mode: gp_settings = brush.gpencil_settings - def draw_color_selector(): - ma = gp_settings.material - row = layout.row(align=True) - if not gp_settings.use_material_pin: - ma = context.object.active_material - icon_id = 0 - if ma: - icon_id = ma.id_data.preview.icon_id - txt_ma = ma.name - maxw = 25 - if len(txt_ma) > maxw: - txt_ma = txt_ma[:maxw - 5] + '..' + txt_ma[-3:] - else: - txt_ma = "" - - sub = row.row() - sub.ui_units_x = 8 - sub.popover( - panel="TOPBAR_PT_gpencil_materials", - text=txt_ma, - icon_value=icon_id, - ) - - row.prop(gp_settings, "use_material_pin", text="") - - if brush.gpencil_tool in {'DRAW', 'FILL'}: - row.separator(factor=1.0) - subrow = row.row(align=True) - row.prop_enum(settings, "color_mode", 'MATERIAL', text="", icon='MATERIAL') - row.prop_enum(settings, "color_mode", 'VERTEXCOLOR', text="", icon='VPAINT_HLT') - sub_row = row.row(align=True) - sub_row.enabled = settings.color_mode == 'VERTEXCOLOR' - sub_row.prop_with_popover(brush, "color", text="", panel="TOPBAR_PT_gpencil_vertexcolor") - row = layout.row(align=True) tool_settings = context.scene.tool_settings settings = tool_settings.gpencil_paint row.template_ID_preview(settings, "brush", rows=3, cols=8, hide_buttons=True) if context.object and brush.gpencil_tool in {'FILL', 'DRAW'}: - draw_color_selector() + from bl_ui.properties_paint_common import ( + brush_basic__draw_color_selector, + ) + brush_basic__draw_color_selector(context, layout, brush, gp_settings, None) if context.object and brush.gpencil_tool == 'TINT': row.separator(factor=0.4) |