Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCian Jinks <cjinks99@gmail.com>2021-09-23 04:23:44 +0300
committerHoward Trickey <howard.trickey@gmail.com>2021-09-23 04:23:44 +0300
commit6e77afe6ec7b6a73f218f1fef264758abcbc778a (patch)
tree350b49ce287b8e32518ed099895588041bc48d93 /release
parenta78d3c5261b55ba2a63d550aafada518a0f88fbe (diff)
Applying patch D12600, GSOC Knife Tools branch
This adds constrained angle mode improvements, snapping to global and local orientation, visible distance and angle measurements, undo capability, x-ray mode, multi-object edit mode. See https://developer.blender.org/D12600 for more details. Note: this project moved some of the default keymappings around a bit, as discussed with users in the thread https://devtalk.blender.org/t/gsoc-2021-knife-tool-improvements-feedback/19047 We'll change the manual documentation in the next couple of days.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/blender_default.py27
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py11
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py26
3 files changed, 44 insertions, 20 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 1b0da23aa4a..5ecbe7715e3 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -5626,21 +5626,24 @@ def km_knife_tool_modal_map(_params):
("PANNING", {"type": 'MIDDLEMOUSE', "value": 'ANY', "any": True}, None),
("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None),
("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None),
- ("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
+ ("UNDO", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
- ("NEW_CUT", {"type": 'E', "value": 'PRESS'}, None),
- ("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None),
- ("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None),
- ("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
- ("SNAP_MIDPOINTS_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
- ("IGNORE_SNAP_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
- ("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
- ("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
- ("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
- ("ANGLE_SNAP_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
- ("CUT_THROUGH_TOGGLE", {"type": 'Z', "value": 'PRESS'}, None),
+ ("NEW_CUT", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
+ ("SNAP_MIDPOINTS_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
+ ("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
+ ("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
+ ("SNAP_MIDPOINTS_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
+ ("IGNORE_SNAP_ON", {"type": 'LEFT_CTRL', "value": 'PRESS', "any": True}, None),
+ ("IGNORE_SNAP_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE', "any": True}, None),
+ ("IGNORE_SNAP_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS', "any": True}, None),
+ ("IGNORE_SNAP_OFF", {"type": 'RIGHT_CTRL', "value": 'RELEASE', "any": True}, None),
+ ("ANGLE_SNAP_TOGGLE", {"type": 'A', "value": 'PRESS'}, None),
+ ("CYCLE_ANGLE_SNAP_EDGE", {"type": 'R', "value": 'PRESS'}, None),
+ ("CUT_THROUGH_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
+ ("SHOW_DISTANCE_ANGLE_TOGGLE", {"type": 'S', "value": 'PRESS'}, None),
+ ("DEPTH_TEST_TOGGLE", {"type": 'V', "value": 'PRESS'}, None),
])
return keymap
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index dbe351eb10c..6a24f072ed0 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -3866,7 +3866,8 @@ def km_knife_tool_modal_map(_params):
("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
("ADD_CUT_CLOSED", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None),
("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None),
- ("NEW_CUT", {"type": 'E', "value": 'PRESS'}, None),
+ ("UNDO", {"type": 'Z', "value": 'PRESS', "ctrl": True}, None),
+ ("NEW_CUT", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
("SNAP_MIDPOINTS_ON", {"type": 'LEFT_CTRL', "value": 'PRESS'}, None),
("SNAP_MIDPOINTS_OFF", {"type": 'LEFT_CTRL', "value": 'RELEASE'}, None),
("SNAP_MIDPOINTS_ON", {"type": 'RIGHT_CTRL', "value": 'PRESS'}, None),
@@ -3875,11 +3876,13 @@ def km_knife_tool_modal_map(_params):
("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
- ("ANGLE_SNAP_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
- ("CUT_THROUGH_TOGGLE", {"type": 'X', "value": 'PRESS'}, None),
+ ("ANGLE_SNAP_TOGGLE", {"type": 'A', "value": 'PRESS'}, None),
+ ("CYCLE_ANGLE_SNAP_EDGE", {"type": 'R', "value": 'PRESS'}, None),
+ ("CUT_THROUGH_TOGGLE", {"type": 'C', "value": 'PRESS'}, None),
("PANNING", {"type": 'MIDDLEMOUSE', "value": 'PRESS', "alt": True}, None),
("PANNING", {"type": 'RIGHTMOUSE', "value": 'PRESS', "alt": True}, None),
- ("CONFIRM", {"type": 'RIGHTMOUSE', "value": 'PRESS'}, None),
+ ("SHOW_DISTANCE_ANGLE_TOGGLE", {"type": 'D', "value": 'PRESS'}, None),
+ ("DEPTH_TEST_TOGGLE", {"type": 'V', "value": 'PRESS'}, None),
])
return keymap
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 77a6ff79598..a4a51cb9910 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1087,11 +1087,29 @@ class _defs_edit_mesh:
@ToolDef.from_fn
def knife():
- def draw_settings(_context, layout, tool):
+ def draw_settings(_context, layout, tool, *, extra=False):
+ show_extra = False
props = tool.operator_properties("mesh.knife_tool")
- layout.prop(props, "use_occlude_geometry")
- layout.prop(props, "only_selected")
-
+ if not extra:
+ row = layout.row()
+ layout.prop(props, "use_occlude_geometry")
+ row = layout.row()
+ layout.prop(props, "only_selected")
+ row = layout.row()
+ layout.prop(props, "xray")
+ region_is_header = bpy.context.region.type == 'TOOL_HEADER'
+ if region_is_header:
+ show_extra = True
+ else:
+ extra = True
+ if extra:
+ layout.use_property_split = True
+ layout.prop(props, "visible_measurements")
+ layout.prop(props, "angle_snapping")
+ layout.label(text="Angle Snapping Increment")
+ layout.row().prop(props, "angle_snapping_increment", text="", expand=True)
+ if show_extra:
+ layout.popover("TOPBAR_PT_tool_settings_extra", text="...")
return dict(
idname="builtin.knife",
label="Knife",