diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-23 15:06:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-23 15:10:56 +0300 |
commit | 83975965a797642eb0aece30c6a887061b34978d (patch) | |
tree | 403c7345ca48a7015317b694248d6421c1fa1d32 | |
parent | 88692baacef170d90e55f6ab89392237a55b1bf3 (diff) |
Keymap: RMB select option to place cursor on Alt-LMB
This allows most tools to activate on press, removing a small but
noticeable distance between the initial press and detection of a drag
event.
Gizmo tweak no longer actives when Alt is held, to avoid conflicting
with cursor placement.
This has the advantage that the gizmo doesn't get in the way when Alt
is used for activating tools or placing the cursor.
-rw-r--r-- | release/scripts/presets/keyconfig/Blender.py | 16 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 253 |
2 files changed, 154 insertions, 115 deletions
diff --git a/release/scripts/presets/keyconfig/Blender.py b/release/scripts/presets/keyconfig/Blender.py index 8a937b4d4b1..eb395dbc3b4 100644 --- a/release/scripts/presets/keyconfig/Blender.py +++ b/release/scripts/presets/keyconfig/Blender.py @@ -85,6 +85,8 @@ class Prefs(bpy.types.KeyConfigPreferences): default=False, update=update_fn, ) + # NOTE: expose `use_alt_tool` and `use_alt_cursor` as two options in the UI + # as the tool-tips and titles are different enough depending on RMB/LMB select. use_alt_tool: BoolProperty( name="Alt Tool Access", description=( @@ -93,6 +95,16 @@ class Prefs(bpy.types.KeyConfigPreferences): default=False, update=update_fn, ) + use_alt_cursor: BoolProperty( + name="Alt Cursor Access", + description=( + "Hold Alt-LMB to place the Cursor (instead of LMB), allows tools to activate on press instead of drag" + ), + default=False, + update=update_fn, + ) + # end note. + use_select_all_toggle: BoolProperty( name="Select All Toggles", description=( @@ -219,6 +231,8 @@ class Prefs(bpy.types.KeyConfigPreferences): row.prop(self, "use_alt_click_leader") if is_select_left: row.prop(self, "use_alt_tool") + else: + row.prop(self, "use_alt_cursor") row = sub.row() row.prop(self, "use_select_all_toggle") row.prop(self, "use_key_activate_tools", text="Key Activates Tools") @@ -269,7 +283,7 @@ def load(): use_v3d_shade_ex_pie=kc_prefs.use_v3d_shade_ex_pie, use_gizmo_drag=(is_select_left and kc_prefs.gizmo_action == 'DRAG'), use_fallback_tool=(True if is_select_left else (kc_prefs.rmb_action == 'FALLBACK_TOOL')), - use_alt_tool=(kc_prefs.use_alt_tool and is_select_left), + use_alt_tool_or_cursor=kc_prefs.use_alt_tool if is_select_left else kc_prefs.use_alt_cursor, use_alt_click_leader=kc_prefs.use_alt_click_leader, use_pie_click_drag=kc_prefs.use_pie_click_drag, ), diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 5ecbe7715e3..4b15cdc25d3 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -31,6 +31,8 @@ class Params: "action_tweak", "tool_mouse", "tool_tweak", + "tool_maybe_tweak", + "tool_maybe_tweak_value", "context_menu_event", "cursor_set_event", "cursor_tweak_event", @@ -74,6 +76,8 @@ class Params: "use_fallback_tool_rmb", # Convenience for: `'CLICK' if params.use_fallback_tool_rmb else params.select_mouse_value`. "select_mouse_value_fallback", + # Convenience for: `{"type": params.tool_maybe_tweak, "value": params.tool_maybe_tweak_value}`. + "tool_maybe_tweak_event", ) def __init__( @@ -92,7 +96,7 @@ class Params: use_v3d_tab_menu=False, use_v3d_shade_ex_pie=False, use_v3d_mmb_pan=False, - use_alt_tool=False, + use_alt_tool_or_cursor=False, use_alt_click_leader=False, use_pie_click_drag=False, v3d_tilde_action='VIEW', @@ -111,8 +115,21 @@ class Params: self.action_tweak = 'EVT_TWEAK_L' self.tool_mouse = 'LEFTMOUSE' self.tool_tweak = 'EVT_TWEAK_L' + if use_alt_tool_or_cursor: + self.tool_maybe_tweak = 'LEFTMOUSE' + self.tool_maybe_tweak_value = 'PRESS' + else: + self.tool_maybe_tweak = 'EVT_TWEAK_L' + self.tool_maybe_tweak_value = 'ANY' + self.context_menu_event = {"type": 'W', "value": 'PRESS'} - self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'CLICK'} + + # Use the "cursor" functionality for RMB select. + if use_alt_tool_or_cursor: + self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'PRESS', "alt": True} + else: + self.cursor_set_event = {"type": 'LEFTMOUSE', "value": 'CLICK'} + self.cursor_tweak_event = None self.use_fallback_tool = use_fallback_tool self.use_fallback_tool_rmb = use_fallback_tool @@ -129,6 +146,8 @@ class Params: self.action_tweak = 'EVT_TWEAK_R' self.tool_mouse = 'LEFTMOUSE' self.tool_tweak = 'EVT_TWEAK_L' + self.tool_maybe_tweak = 'EVT_TWEAK_L' + self.tool_maybe_tweak_value = 'ANY' if self.legacy: self.context_menu_event = {"type": 'W', "value": 'PRESS'} @@ -141,7 +160,8 @@ class Params: self.use_fallback_tool_rmb = False self.select_mouse_value_fallback = self.select_mouse_value - if use_alt_tool: + # Use the "tool" functionality for LMB select. + if use_alt_tool_or_cursor: # Allow `Alt` to be pressed or not. self.tool_modifier = {"alt": -1} else: @@ -168,6 +188,9 @@ class Params: else: self.pie_value = 'CLICK_DRAG' + # Convenience variables. + self.tool_maybe_tweak_event = {"type": self.tool_maybe_tweak, "value": self.tool_maybe_tweak_value} + # ------------------------------------------------------------------------------ # Constants @@ -188,6 +211,13 @@ def _fallback_id(text, fallback): return text +def any_except(*args): + mod = {"ctrl": -1, "alt": -1, "shift": -1, "oskey": -1} + for arg in args: + del mod[arg] + return mod + + # ------------------------------------------------------------------------------ # Keymap Item Wrappers @@ -300,20 +330,23 @@ def _template_items_object_subdivision_set(): def _template_items_gizmo_tweak_value(): return [ - ("gizmogroup.gizmo_tweak", {"type": 'LEFTMOUSE', "value": 'PRESS', "any": True}, None), + ("gizmogroup.gizmo_tweak", + {"type": 'LEFTMOUSE', "value": 'PRESS', **any_except("alt")}, None), ] def _template_items_gizmo_tweak_value_click_drag(): return [ - ("gizmogroup.gizmo_tweak", {"type": 'LEFTMOUSE', "value": 'CLICK', "any": True}, None), - ("gizmogroup.gizmo_tweak", {"type": 'EVT_TWEAK_L', "value": 'ANY', "any": True}, None), + ("gizmogroup.gizmo_tweak", + {"type": 'LEFTMOUSE', "value": 'CLICK', **any_except("alt")}, None), + ("gizmogroup.gizmo_tweak", + {"type": 'EVT_TWEAK_L', "value": 'ANY', **any_except("alt")}, None), ] def _template_items_gizmo_tweak_value_drag(): return [ - ("gizmogroup.gizmo_tweak", {"type": 'EVT_TWEAK_L', "value": 'ANY', "any": True}, None), + ("gizmogroup.gizmo_tweak", {"type": 'EVT_TWEAK_L', "value": 'ANY', **any_except("alt")}, None), ] @@ -6046,7 +6079,7 @@ def km_generic_tool_annotate_line(params): "Generic Tool: Annotate Line", {"space_type": 'EMPTY', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.annotate", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.annotate", params.tool_maybe_tweak_event, {"properties": [("mode", 'DRAW_STRAIGHT'), ("wait_for_input", False)]}), ("gpencil.annotate", {"type": params.tool_mouse, "value": 'PRESS', "ctrl": True}, {"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}), @@ -6095,8 +6128,12 @@ def km_image_editor_tool_uv_cursor(params): "Image Editor Tool: Uv, Cursor", {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("uv.cursor_set", {"type": params.tool_mouse, "value": 'PRESS'}, None), - ("transform.translate", {"type": params.tool_tweak, "value": 'ANY'}, + ("uv.cursor_set", + {"type": params.tool_mouse, "value": 'PRESS'}, + None), + # Don't use `tool_maybe_tweak_event` since it conflicts with `PRESS` that places the cursor. + ("transform.translate", + {"type": params.tool_tweak, "value": 'ANY'}, {"properties": [("release_confirm", True), ("cursor_transform", True)]}), ]}, ) @@ -6121,8 +6158,7 @@ def km_image_editor_tool_uv_select_box(params, *, fallback): {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions_simple( "uv.select_box", - type=params.select_tweak if fallback else params.tool_tweak, - value='ANY')), + **({"type": params.select_tweak, "value": 'ANY'} if fallback else params.tool_maybe_tweak_event))), *_template_uv_select_for_fallback(params, fallback), ]}, ) @@ -6151,9 +6187,7 @@ def km_image_editor_tool_uv_select_lasso(params, *, fallback): {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions_simple( "uv.select_lasso", - type=params.select_tweak if fallback else params.tool_tweak, - value='ANY') - ), + **({"type": params.select_tweak, "value": 'ANY'} if fallback else params.tool_maybe_tweak_event))), *_template_uv_select_for_fallback(params, fallback), ]}, ) @@ -6164,7 +6198,7 @@ def km_image_editor_tool_uv_rip_region(params): "Image Editor Tool: Uv, Rip Region", {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("uv.rip_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("uv.rip_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_translate", [("release_confirm", True)])]}), ]}, ) @@ -6194,7 +6228,7 @@ def km_image_editor_tool_uv_move(params): "Image Editor Tool: Uv, Move", {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("transform.translate", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.translate", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6205,7 +6239,7 @@ def km_image_editor_tool_uv_rotate(params): "Image Editor Tool: Uv, Rotate", {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("transform.rotate", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.rotate", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6216,7 +6250,7 @@ def km_image_editor_tool_uv_scale(params): "Image Editor Tool: Uv, Scale", {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("transform.resize", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.resize", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6241,7 +6275,8 @@ def km_node_editor_tool_select_box(params, *, fallback): {"space_type": 'NODE_EDITOR', "region_type": 'WINDOW'}, {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions_simple( - "node.select_box", type=params.tool_tweak, value='ANY', + "node.select_box", + type=params.tool_maybe_tweak, value=params.tool_maybe_tweak_value, properties=[("tweak", True)], )), ]}, @@ -6288,6 +6323,7 @@ def km_3d_view_tool_cursor(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ ("view3d.cursor3d", {"type": params.tool_mouse, "value": 'PRESS'}, None), + # Don't use `tool_maybe_tweak_event` since it conflicts with `PRESS` that places the cursor. ("transform.translate", {"type": params.tool_tweak, "value": 'ANY'}, {"properties": [("release_confirm", True), ("cursor_transform", True)]}), ]}, @@ -6314,8 +6350,7 @@ def km_3d_view_tool_select_box(params, *, fallback): {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions( "view3d.select_box", - type=params.select_tweak if fallback else params.tool_tweak, - value='ANY')), + **({"type": params.select_tweak, "value": 'ANY'} if fallback else params.tool_maybe_tweak_event))), *_template_view3d_select_for_fallback(params, fallback), ]}, ) @@ -6345,8 +6380,7 @@ def km_3d_view_tool_select_lasso(params, *, fallback): {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions( "view3d.select_lasso", - type=params.select_tweak if fallback else params.tool_tweak, - value='ANY')), + **({"type": params.select_tweak, "value": 'ANY'} if fallback else params.tool_maybe_tweak_event))), *_template_view3d_select_for_fallback(params, fallback), ]} ) @@ -6357,8 +6391,7 @@ def km_3d_view_tool_transform(params): "3D View Tool: Transform", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.from_gizmo", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, None), + ("transform.from_gizmo", {**params.tool_maybe_tweak_event, **params.tool_modifier}, None), ]}, ) @@ -6368,8 +6401,7 @@ def km_3d_view_tool_move(params): "3D View Tool: Move", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.translate", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.translate", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6380,8 +6412,7 @@ def km_3d_view_tool_rotate(params): "3D View Tool: Rotate", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.rotate", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.rotate", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6392,14 +6423,14 @@ def km_3d_view_tool_scale(params): "3D View Tool: Scale", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.resize", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.resize", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) def km_3d_view_tool_shear(params): + # Don't use 'tool_maybe_tweak_value' since we would loose tweak direction support. return ( "3D View Tool: Shear", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, @@ -6424,7 +6455,7 @@ def km_3d_view_tool_measure(params): "3D View Tool: Measure", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("view3d.ruler_add", {"type": params.tool_tweak, "value": 'ANY'}, None), + ("view3d.ruler_add", params.tool_maybe_tweak_event, None), ("view3d.ruler_remove", {"type": 'X', "value": 'PRESS'}, None), ("view3d.ruler_remove", {"type": 'DEL', "value": 'PRESS'}, None), ]}, @@ -6436,7 +6467,7 @@ def km_3d_view_tool_pose_breakdowner(params): "3D View Tool: Pose, Breakdowner", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("pose.breakdown", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, None), + ("pose.breakdown", {**params.tool_maybe_tweak_event, **params.tool_modifier}, None), ]}, ) @@ -6446,8 +6477,7 @@ def km_3d_view_tool_pose_push(params): "3D View Tool: Pose, Push", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("pose.push", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, None), + ("pose.push", {**params.tool_maybe_tweak_event, **params.tool_modifier}, None), ]}, ) @@ -6457,8 +6487,7 @@ def km_3d_view_tool_pose_relax(params): "3D View Tool: Pose, Relax", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("pose.relax", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, None), + ("pose.relax", {**params.tool_maybe_tweak_event, **params.tool_modifier}, None), ]}, ) @@ -6468,8 +6497,7 @@ def km_3d_view_tool_edit_armature_roll(params): "3D View Tool: Edit Armature, Roll", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.transform", - {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.transform", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True), ("mode", 'BONE_ROLL')]}), ]}, ) @@ -6480,7 +6508,7 @@ def km_3d_view_tool_edit_armature_bone_size(params): "3D View Tool: Edit Armature, Bone Size", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.transform", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.transform", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True), ("mode", 'BONE_ENVELOPE')]}), ]}, ) @@ -6492,7 +6520,7 @@ def km_3d_view_tool_edit_armature_bone_envelope(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.bbone_resize", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.bbone_resize", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6503,7 +6531,7 @@ def km_3d_view_tool_edit_armature_extrude(params): "3D View Tool: Edit Armature, Extrude", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("armature.extrude_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("armature.extrude_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_translate", [("release_confirm", True)])]}), ]}, ) @@ -6524,7 +6552,12 @@ def km_3d_view_tool_interactive_add(params): "3D View Tool: Object, Add Primitive", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("view3d.interactive_add", {"type": params.tool_tweak, "value": 'ANY', "any": True}, + ("view3d.interactive_add", + {**params.tool_maybe_tweak_event, + # While "Alt" isn't an important shortcut to support, + # when the preferences to activate tools when "Alt" is held is used, + # it's illogical not to support holding "Alt", even though it is not required. + **({"any": True} if "alt" in params.tool_modifier else any_except("alt"))}, {"properties": [("wait_for_input", False)]}), ]}, ) @@ -6535,7 +6568,7 @@ def km_3d_view_tool_edit_mesh_extrude_region(params): "3D View Tool: Edit Mesh, Extrude Region", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.extrude_context_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.extrude_context_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_translate", [("release_confirm", True)])]}), ]}, ) @@ -6546,7 +6579,7 @@ def km_3d_view_tool_edit_mesh_extrude_manifold(params): "3D View Tool: Edit Mesh, Extrude Manifold", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.extrude_manifold", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.extrude_manifold", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [ ("MESH_OT_extrude_region", [("use_dissolve_ortho_edges", True)]), ("TRANSFORM_OT_translate", [ @@ -6565,7 +6598,7 @@ def km_3d_view_tool_edit_mesh_extrude_along_normals(params): "3D View Tool: Edit Mesh, Extrude Along Normals", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.extrude_region_shrink_fatten", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.extrude_region_shrink_fatten", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_shrink_fatten", [("release_confirm", True)])]}), ]}, ) @@ -6576,7 +6609,7 @@ def km_3d_view_tool_edit_mesh_extrude_individual(params): "3D View Tool: Edit Mesh, Extrude Individual", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.extrude_faces_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.extrude_faces_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_shrink_fatten", [("release_confirm", True)])]}), ]}, ) @@ -6598,7 +6631,7 @@ def km_3d_view_tool_edit_mesh_inset_faces(params): "3D View Tool: Edit Mesh, Inset Faces", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.inset", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.inset", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6609,7 +6642,7 @@ def km_3d_view_tool_edit_mesh_bevel(params): "3D View Tool: Edit Mesh, Bevel", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.bevel", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.bevel", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6656,7 +6689,7 @@ def km_3d_view_tool_edit_mesh_bisect(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ # No need for `tool_modifier` since this takes all input. - ("mesh.bisect", {"type": params.tool_tweak, "value": 'ANY'}, None), + ("mesh.bisect", params.tool_maybe_tweak_event, None), ]}, ) @@ -6681,7 +6714,7 @@ def km_3d_view_tool_edit_mesh_spin(params): "3D View Tool: Edit Mesh, Spin", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.spin", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, None), + ("mesh.spin", {**params.tool_maybe_tweak_event, **params.tool_modifier}, None), ]}, ) @@ -6691,7 +6724,7 @@ def km_3d_view_tool_edit_mesh_spin_duplicate(params): "3D View Tool: Edit Mesh, Spin Duplicates", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.spin", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.spin", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("dupli", True)]}), ]}, ) @@ -6702,7 +6735,7 @@ def km_3d_view_tool_edit_mesh_smooth(params): "3D View Tool: Edit Mesh, Smooth", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.vertices_smooth", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.vertices_smooth", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("wait_for_input", False)]}), ]}, ) @@ -6713,7 +6746,7 @@ def km_3d_view_tool_edit_mesh_randomize(params): "3D View Tool: Edit Mesh, Randomize", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.vertex_random", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.vertex_random", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("wait_for_input", False)]}), ]}, ) @@ -6724,7 +6757,7 @@ def km_3d_view_tool_edit_mesh_edge_slide(params): "3D View Tool: Edit Mesh, Edge Slide", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.edge_slide", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.edge_slide", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6735,7 +6768,7 @@ def km_3d_view_tool_edit_mesh_vertex_slide(params): "3D View Tool: Edit Mesh, Vertex Slide", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.vert_slide", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.vert_slide", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6746,7 +6779,7 @@ def km_3d_view_tool_edit_mesh_shrink_fatten(params): "3D View Tool: Edit Mesh, Shrink/Fatten", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.shrink_fatten", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.shrink_fatten", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6757,7 +6790,7 @@ def km_3d_view_tool_edit_mesh_push_pull(params): "3D View Tool: Edit Mesh, Push/Pull", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.push_pull", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.push_pull", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6768,7 +6801,7 @@ def km_3d_view_tool_edit_mesh_to_sphere(params): "3D View Tool: Edit Mesh, To Sphere", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.tosphere", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.tosphere", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6779,7 +6812,7 @@ def km_3d_view_tool_edit_mesh_rip_region(params): "3D View Tool: Edit Mesh, Rip Region", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.rip_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.rip_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_translate", [("release_confirm", True)])]}), ]}, ) @@ -6790,7 +6823,7 @@ def km_3d_view_tool_edit_mesh_rip_edge(params): "3D View Tool: Edit Mesh, Rip Edge", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("mesh.rip_edge_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("mesh.rip_edge_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_translate", [("release_confirm", True)])]}), ]}, ) @@ -6813,7 +6846,7 @@ def km_3d_view_tool_edit_curve_tilt(params): "3D View Tool: Edit Curve, Tilt", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.tilt", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.tilt", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("release_confirm", True)]}), ]}, ) @@ -6824,7 +6857,7 @@ def km_3d_view_tool_edit_curve_radius(params): "3D View Tool: Edit Curve, Radius", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.transform", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.transform", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("mode", 'CURVE_SHRINKFATTEN'), ("release_confirm", True)]}), ]}, ) @@ -6835,7 +6868,7 @@ def km_3d_view_tool_edit_curve_randomize(params): "3D View Tool: Edit Curve, Randomize", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("transform.vertex_random", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("transform.vertex_random", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("wait_for_input", False)]}), ]}, ) @@ -6846,7 +6879,7 @@ def km_3d_view_tool_edit_curve_extrude(params): "3D View Tool: Edit Curve, Extrude", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("curve.extrude_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, + ("curve.extrude_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, {"properties": [("TRANSFORM_OT_translate", [("release_confirm", True)])]}), ]}, ) @@ -6868,9 +6901,9 @@ def km_3d_view_tool_sculpt_box_hide(params): "3D View Tool: Sculpt, Box Hide", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("paint.hide_show", {"type": params.tool_tweak, "value": 'ANY'}, + ("paint.hide_show", params.tool_maybe_tweak_event, {"properties": [("action", 'HIDE')]}), - ("paint.hide_show", {"type": params.tool_tweak, "value": 'ANY', "ctrl": True}, + ("paint.hide_show", {**params.tool_maybe_tweak_event, "ctrl": True}, {"properties": [("action", 'SHOW')]}), ("paint.hide_show", {"type": params.select_mouse, "value": params.select_mouse_value}, {"properties": [("action", 'SHOW'), ("area", 'ALL')]}), @@ -6883,9 +6916,9 @@ def km_3d_view_tool_sculpt_box_mask(params): "3D View Tool: Sculpt, Box Mask", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("paint.mask_box_gesture", {"type": params.tool_tweak, "value": 'ANY'}, + ("paint.mask_box_gesture", params.tool_maybe_tweak_event, {"properties": [("value", 1.0)]}), - ("paint.mask_box_gesture", {"type": params.tool_tweak, "value": 'ANY', "ctrl": True}, + ("paint.mask_box_gesture", {**params.tool_maybe_tweak_event, "ctrl": True}, {"properties": [("value", 0.0)]}), ]}, ) @@ -6896,9 +6929,9 @@ def km_3d_view_tool_sculpt_lasso_mask(params): "3D View Tool: Sculpt, Lasso Mask", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("paint.mask_lasso_gesture", {"type": params.tool_tweak, "value": 'ANY'}, + ("paint.mask_lasso_gesture", params.tool_maybe_tweak_event, {"properties": [("value", 1.0)]}), - ("paint.mask_lasso_gesture", {"type": params.tool_tweak, "value": 'ANY', "ctrl": True}, + ("paint.mask_lasso_gesture", {**params.tool_maybe_tweak_event, "ctrl": True}, {"properties": [("value", 0.0)]}), ]}, ) @@ -6909,8 +6942,7 @@ def km_3d_view_tool_sculpt_box_face_set(params): "3D View Tool: Sculpt, Box Face Set", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.face_set_box_gesture", {"type": params.tool_tweak, "value": 'ANY'}, - None), + ("sculpt.face_set_box_gesture", params.tool_maybe_tweak_event, None), ]}, ) @@ -6920,8 +6952,7 @@ def km_3d_view_tool_sculpt_lasso_face_set(params): "3D View Tool: Sculpt, Lasso Face Set", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.face_set_lasso_gesture", {"type": params.tool_tweak, "value": 'ANY'}, - None), + ("sculpt.face_set_lasso_gesture", params.tool_maybe_tweak_event, None), ]}, ) @@ -6931,8 +6962,7 @@ def km_3d_view_tool_sculpt_box_trim(params): "3D View Tool: Sculpt, Box Trim", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.trim_box_gesture", {"type": params.tool_tweak, "value": 'ANY'}, - None), + ("sculpt.trim_box_gesture", params.tool_maybe_tweak_event, None), ]}, ) @@ -6942,8 +6972,7 @@ def km_3d_view_tool_sculpt_lasso_trim(params): "3D View Tool: Sculpt, Lasso Trim", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.trim_lasso_gesture", {"type": params.tool_tweak, "value": 'ANY'}, - None), + ("sculpt.trim_lasso_gesture", params.tool_maybe_tweak_event, None), ]}, ) @@ -6953,9 +6982,9 @@ def km_3d_view_tool_sculpt_line_mask(params): "3D View Tool: Sculpt, Line Mask", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("paint.mask_line_gesture", {"type": params.tool_tweak, "value": 'ANY'}, + ("paint.mask_line_gesture", params.tool_maybe_tweak_event, {"properties": [("value", 1.0)]}), - ("paint.mask_line_gesture", {"type": params.tool_tweak, "value": 'ANY', "ctrl": True}, + ("paint.mask_line_gesture", {**params.tool_maybe_tweak_event, "ctrl": True}, {"properties": [("value", 0.0)]}), ]}, ) @@ -6966,8 +6995,7 @@ def km_3d_view_tool_sculpt_line_project(params): "3D View Tool: Sculpt, Line Project", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.project_line_gesture", {"type": params.tool_tweak, "value": 'ANY'}, - None), + ("sculpt.project_line_gesture", params.tool_maybe_tweak_event, None), ]}, ) @@ -6977,8 +7005,7 @@ def km_3d_view_tool_sculpt_mesh_filter(params): "3D View Tool: Sculpt, Mesh Filter", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.mesh_filter", {"type": params.tool_tweak, "value": 'ANY'}, - None) + ("sculpt.mesh_filter", params.tool_maybe_tweak_event, None) ]}, ) @@ -6988,8 +7015,7 @@ def km_3d_view_tool_sculpt_cloth_filter(params): "3D View Tool: Sculpt, Cloth Filter", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.cloth_filter", {"type": params.tool_tweak, "value": 'ANY'}, - None) + ("sculpt.cloth_filter", params.tool_maybe_tweak_event, None) ]}, ) @@ -6999,8 +7025,7 @@ def km_3d_view_tool_sculpt_color_filter(params): "3D View Tool: Sculpt, Color Filter", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("sculpt.color_filter", {"type": params.tool_tweak, "value": 'ANY'}, - None) + ("sculpt.color_filter", params.tool_maybe_tweak_event, None) ]}, ) @@ -7054,7 +7079,7 @@ def km_3d_view_tool_paint_weight_gradient(params): "3D View Tool: Paint Weight, Gradient", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("paint.weight_gradient", {"type": params.tool_tweak, "value": 'ANY'}, None), + ("paint.weight_gradient", params.tool_maybe_tweak_event, None), ]}, ) @@ -7064,7 +7089,7 @@ def km_3d_view_tool_paint_gpencil_line(params): "3D View Tool: Paint Gpencil, Line", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.primitive_line", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.primitive_line", params.tool_maybe_tweak_event, {"properties": [("wait_for_input", False)]}), ("gpencil.primitive_line", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, {"properties": [("wait_for_input", False)]}), @@ -7081,7 +7106,7 @@ def km_3d_view_tool_paint_gpencil_polyline(params): "3D View Tool: Paint Gpencil, Polyline", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.primitive_polyline", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.primitive_polyline", params.tool_maybe_tweak_event, {"properties": [("wait_for_input", False)]}), ("gpencil.primitive_polyline", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, {"properties": [("wait_for_input", False)]}), @@ -7096,7 +7121,7 @@ def km_3d_view_tool_paint_gpencil_box(params): "3D View Tool: Paint Gpencil, Box", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.primitive_box", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.primitive_box", params.tool_maybe_tweak_event, {"properties": [("wait_for_input", False)]}), ("gpencil.primitive_box", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, {"properties": [("wait_for_input", False)]}), @@ -7113,7 +7138,7 @@ def km_3d_view_tool_paint_gpencil_circle(params): "3D View Tool: Paint Gpencil, Circle", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.primitive_circle", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.primitive_circle", params.tool_maybe_tweak_event, {"properties": [("wait_for_input", False)]}), ("gpencil.primitive_circle", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, {"properties": [("wait_for_input", False)]}), @@ -7130,7 +7155,7 @@ def km_3d_view_tool_paint_gpencil_arc(params): "3D View Tool: Paint Gpencil, Arc", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.primitive_curve", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.primitive_curve", params.tool_maybe_tweak_event, {"properties": [("type", 'ARC'), ("wait_for_input", False)]}), ("gpencil.primitive_curve", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, {"properties": [("type", 'ARC'), ("wait_for_input", False)]}), @@ -7147,7 +7172,7 @@ def km_3d_view_tool_paint_gpencil_curve(params): "3D View Tool: Paint Gpencil, Curve", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.primitive_curve", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.primitive_curve", params.tool_maybe_tweak_event, {"properties": [("type", 'CURVE'), ("wait_for_input", False)]}), # Lasso select ("gpencil.select_lasso", {"type": params.action_tweak, "value": 'ANY', "ctrl": True, "alt": True}, None), @@ -7187,7 +7212,7 @@ def km_3d_view_tool_paint_gpencil_interpolate(params): "3D View Tool: Paint Gpencil, Interpolate", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.interpolate", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.interpolate", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7212,7 +7237,8 @@ def km_3d_view_tool_edit_gpencil_select_box(params, *, fallback): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions( - "gpencil.select_box", type=params.select_tweak if fallback else params.tool_tweak, value='ANY')), + "gpencil.select_box", + **({"type": params.select_tweak, "value": 'ANY'} if fallback else params.tool_maybe_tweak_event))), *_template_view3d_gpencil_select_for_fallback(params, fallback), ]}, ) @@ -7242,8 +7268,7 @@ def km_3d_view_tool_edit_gpencil_select_lasso(params, *, fallback): {"items": [ *([] if (fallback and not params.use_fallback_tool) else _template_items_tool_select_actions( "gpencil.select_lasso", - type=params.select_tweak if fallback else params.tool_tweak, - value='ANY')), + **({"type": params.select_tweak, "value": 'ANY'} if fallback else params.tool_maybe_tweak_event))), *_template_view3d_gpencil_select_for_fallback(params, fallback), ]} ) @@ -7254,7 +7279,7 @@ def km_3d_view_tool_edit_gpencil_extrude(params): "3D View Tool: Edit Gpencil, Extrude", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.extrude_move", {"type": params.tool_tweak, "value": 'ANY', **params.tool_modifier}, None), + ("gpencil.extrude_move", {**params.tool_maybe_tweak_event, **params.tool_modifier}, None), ]}, ) @@ -7265,7 +7290,7 @@ def km_3d_view_tool_edit_gpencil_radius(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ # No need for `tool_modifier` since this takes all input. - ("transform.transform", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.transform", params.tool_maybe_tweak_event, {"properties": [("mode", 'GPENCIL_SHRINKFATTEN'), ("release_confirm", True)]}), ]}, ) @@ -7277,7 +7302,7 @@ def km_3d_view_tool_edit_gpencil_bend(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ # No need for `tool_modifier` since this takes all input. - ("transform.bend", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.bend", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7289,7 +7314,7 @@ def km_3d_view_tool_edit_gpencil_shear(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ # No need for `tool_modifier` since this takes all input. - ("transform.shear", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.shear", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7301,7 +7326,7 @@ def km_3d_view_tool_edit_gpencil_to_sphere(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ # No need for `tool_modifier` since this takes all input. - ("transform.tosphere", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.tosphere", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7313,7 +7338,7 @@ def km_3d_view_tool_edit_gpencil_transform_fill(params): {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ # No need for `tool_modifier` since this takes all input. - ("gpencil.transform_fill", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.transform_fill", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7324,7 +7349,7 @@ def km_3d_view_tool_edit_gpencil_interpolate(params): "3D View Tool: Edit Gpencil, Interpolate", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, {"items": [ - ("gpencil.interpolate", {"type": params.tool_tweak, "value": 'ANY'}, + ("gpencil.interpolate", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7342,7 +7367,7 @@ def km_3d_view_tool_sculpt_gpencil_select_box(params): return ( "3D View Tool: Sculpt Gpencil, Select Box", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, - {"items": _template_items_tool_select_actions("gpencil.select_box", type=params.tool_tweak, value='ANY')}, + {"items": _template_items_tool_select_actions("gpencil.select_box", **params.tool_maybe_tweak_event)}, ) @@ -7361,7 +7386,7 @@ def km_3d_view_tool_sculpt_gpencil_select_lasso(params): return ( "3D View Tool: Sculpt Gpencil, Select Lasso", {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, - {"items": _template_items_tool_select_actions("gpencil.select_lasso", type=params.tool_tweak, value='ANY')}, + {"items": _template_items_tool_select_actions("gpencil.select_lasso", **params.tool_maybe_tweak_event)}, ) @@ -7384,7 +7409,7 @@ def km_sequencer_editor_tool_select_box(params, *, fallback): {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, {"items": [ *_template_items_tool_select_actions_simple( - "sequencer.select_box", type=params.tool_tweak, value='ANY', + "sequencer.select_box", **params.tool_maybe_tweak_event, properties=[("tweak", params.select_mouse == 'LEFTMOUSE')], ), # RMB select can already set the frame, match the tweak tool. @@ -7425,7 +7450,7 @@ def km_sequencer_editor_tool_move(params): "Sequencer Tool: Move", {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("transform.translate", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.translate", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7436,7 +7461,7 @@ def km_sequencer_editor_tool_rotate(params): "Sequencer Tool: Rotate", {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("transform.rotate", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.rotate", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) @@ -7447,7 +7472,7 @@ def km_sequencer_editor_tool_scale(params): "Sequencer Tool: Scale", {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - ("transform.resize", {"type": params.tool_tweak, "value": 'ANY'}, + ("transform.resize", params.tool_maybe_tweak_event, {"properties": [("release_confirm", True)]}), ]}, ) |