diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-23 05:25:55 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-23 05:25:55 +0300 |
commit | 6703c7f7f1f68ae59f9ccbf4fcabc3c035d648bf (patch) | |
tree | bf5def93b54ba810bbaef693ecc79d81e97e635b /release | |
parent | 716a8241d387180fd8ad69cdec33633bc7a0f963 (diff) |
Bevel: Refactor profile type input to use an enum
This will allow the easier addition of a constant radius mode in the
future and some changes in the UI to mirror the recent similar change
from "Only Vertices" to the "Affect" enum.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 27 |
2 files changed, 20 insertions, 9 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 68340443a78..33c16b99348 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -5179,7 +5179,7 @@ def km_bevel_modal_map(_params): ("MARK_SHARP_TOGGLE", {"type": 'K', "value": 'PRESS', "any": True}, None), ("OUTER_MITER_CHANGE", {"type": 'O', "value": 'PRESS', "any": True}, None), ("INNER_MITER_CHANGE", {"type": 'I', "value": 'PRESS', "any": True}, None), - ("CUSTOM_PROFILE_TOGGLE", {"type": 'Z', "value": 'PRESS', "any": True}, None), + ("PROFILE_TYPE_CHANGE", {"type": 'Z', "value": 'PRESS', "any": True}, None), ("VERTEX_MESH_CHANGE", {"type": 'N', "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 9f26abec805..bfd5be8862d 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -747,18 +747,30 @@ class _defs_edit_mesh: layout.prop(props, "offset_type") layout.prop(props, "segments") - layout.prop(props, "profile", slider=True) + + row = layout.row() + row.prop(props, "profile_type", expand=True) + if props.profile_type == 'SUPERELLIPSE': + layout.prop(props, "profile", text="Shape", slider=True) if region_type == 'TOOL_HEADER': layout.popover("TOPBAR_PT_tool_settings_extra", text="...") else: extra = True - if extra or region_type != 'TOOL_HEADER': - layout.prop(props, "vertex_only") - layout.prop(props, "clamp_overlap") - layout.prop(props, "loop_slide") - layout.prop(props, "harden_normals") + if extra: + layout.use_property_split = True + layout.use_property_decorate = False + + if props.profile_type == 'CUSTOM': + layout.prop(props, "profile", text="Miter Shape", slider=True) + + col = layout.column() + col.prop(props, "vertex_only") + col.prop(props, "clamp_overlap") + col.prop(props, "loop_slide") + col.prop(props, "harden_normals") + col = layout.column(heading="Mark") col.prop(props, "mark_seam", text="Seam") col.prop(props, "mark_sharp", text="Sharp") @@ -770,8 +782,7 @@ class _defs_edit_mesh: if props.miter_inner == 'ARC': layout.prop(props, "spread") - layout.prop(props, "use_custom_profile") - if props.use_custom_profile: + if props.profile_type == 'CUSTOM': tool_settings = context.tool_settings layout.template_curveprofile(tool_settings, "custom_bevel_profile_preset") |