diff options
author | Hans Goudey <h.goudey@me.com> | 2020-07-21 23:32:00 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-07-21 23:32:00 +0300 |
commit | 4aa2a5481cec4edc4694ee1edbde4ed3f3986313 (patch) | |
tree | 0dd39e7392e62963a2bcb7d82249e9c84e032fb2 /release/scripts | |
parent | a39da2cbca19102589d5141c80a6bc013bd4c963 (diff) |
Bevel: Refactor "Vertex Only" to an enum
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.
This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.
Tests are adjusted and still pass.
Diffstat (limited to 'release/scripts')
3 files changed, 26 insertions, 14 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 9fdb62a7e8a..ef4e1a9f77b 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -4456,9 +4456,9 @@ def km_mesh(params): {"properties": [("TRANSFORM_OT_edge_slide", [("release_confirm", False), ],)]}), ("mesh.inset", {"type": 'I', "value": 'PRESS'}, None), ("mesh.bevel", {"type": 'B', "value": 'PRESS', "ctrl": True}, - {"properties": [("vertex_only", False)]}), + {"properties": [("affect", 'EDGES')]}), ("mesh.bevel", {"type": 'B', "value": 'PRESS', "shift": True, "ctrl": True}, - {"properties": [("vertex_only", True)]}), + {"properties": [("affect", 'VERTICES')]}), # Selection modes. *_template_items_editmode_mesh_select_mode(params), # Loop Select with alt. Double click in case MMB emulation is on (below). @@ -5210,7 +5210,7 @@ def km_bevel_modal_map(_params): ("SEGMENTS_DOWN", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "any": True}, None), ("OFFSET_MODE_CHANGE", {"type": 'M', "value": 'PRESS', "any": True}, None), ("CLAMP_OVERLAP_TOGGLE", {"type": 'C', "value": 'PRESS', "any": True}, None), - ("VERTEX_ONLY_TOGGLE", {"type": 'V', "value": 'PRESS', "any": True}, None), + ("AFFECT_CHANGE", {"type": 'V', "value": 'PRESS', "any": True}, None), ("HARDEN_NORMALS_TOGGLE", {"type": 'H', "value": 'PRESS', "any": True}, None), ("MARK_SEAM_TOGGLE", {"type": 'U', "value": 'PRESS', "any": True}, None), ("MARK_SHARP_TOGGLE", {"type": 'K', "value": 'PRESS', "any": True}, None), diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index ce48b92c419..2b35eb15cdc 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -744,10 +744,14 @@ class _defs_edit_mesh: region_is_header = context.region.type == 'TOOL_HEADER' + edge_bevel = props.affect == 'EDGES' + if not extra: if region_is_header: layout.prop(props, "offset_type", text="") else: + layout.row().prop(props, "affect", expand=True) + layout.prop(props, "offset_type") layout.prop(props, "segments") @@ -766,25 +770,33 @@ class _defs_edit_mesh: layout.use_property_split = True layout.use_property_decorate = False + if region_is_header: + layout.row().prop(props, "affect", expand=True) + if props.profile_type == 'CUSTOM': - layout.prop(props, "profile", text="Miter Shape", slider=True) + col = layout.column() + col.active = edge_bevel + col.prop(props, "profile", text="Miter Shape", slider=True) + + layout.prop(props, "material") col = layout.column() - col.prop(props, "vertex_only") + col.prop(props, "harden_normals") col.prop(props, "clamp_overlap") col.prop(props, "loop_slide") - col.prop(props, "harden_normals") col = layout.column(heading="Mark") + col.active = edge_bevel col.prop(props, "mark_seam", text="Seam") col.prop(props, "mark_sharp", text="Sharp") - layout.prop(props, "material") - layout.prop(props, "miter_outer", text="Outer Miter") - layout.prop(props, "miter_inner", text="Inner Miter") + col = layout.column() + col.active = edge_bevel + col.prop(props, "miter_outer", text="Miter Outer") + col.prop(props, "miter_inner", text="Inner") if props.miter_inner == 'ARC': - layout.prop(props, "spread") + col.prop(props, "spread") if props.profile_type == 'CUSTOM': tool_settings = context.tool_settings diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 3a5efc30f50..8880d8c5378 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3697,7 +3697,7 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu): col.separator() col.operator("mesh.extrude_vertices_move", text="Extrude Vertices") - col.operator("mesh.bevel", text="Bevel Vertices").vertex_only = True + col.operator("mesh.bevel", text="Bevel Vertices").affect = 'VERTICES' if selected_verts_len > 1: col.separator() @@ -3746,7 +3746,7 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu): col.separator() col.operator("mesh.extrude_edges_move", text="Extrude Edges") - col.operator("mesh.bevel", text="Bevel Edges").vertex_only = False + col.operator("mesh.bevel", text="Bevel Edges").affect = 'EDGES' if selected_edges_len >= 2: col.operator("mesh.bridge_edge_loops") if selected_edges_len >= 1: @@ -3920,7 +3920,7 @@ class VIEW3D_MT_edit_mesh_vertices(Menu): layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("mesh.extrude_vertices_move", text="Extrude Vertices") - layout.operator("mesh.bevel", text="Bevel Vertices").vertex_only = True + layout.operator("mesh.bevel", text="Bevel Vertices").affect = 'VERTICES' layout.separator() @@ -4005,7 +4005,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu): layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("mesh.extrude_edges_move", text="Extrude Edges") - layout.operator("mesh.bevel", text="Bevel Edges").vertex_only = False + layout.operator("mesh.bevel", text="Bevel Edges").affect = 'EDGES' layout.operator("mesh.bridge_edge_loops") layout.operator("mesh.screw") |