Fix T74600: Sequencer blade tool inaccessible with RMB select

Declare `anim.change_frame` explicitly for each editor.

In sequencer, scrubbing in editor area is possible only with
select/tweak tool.

This change is to resolve conflict between scrubbing and tool actions.
This commit is contained in:
Campbell Barton 2020-04-20 17:15:47 +10:00
parent 23bb42a06e
commit 0e6c56760c
Notes: blender-bot 2023-02-14 02:41:05 +01:00
Referenced by issue #74600, Sequencer Blade tool does not work with Right Click select enabled in the keymap
1 changed files with 14 additions and 9 deletions

View File

@ -296,6 +296,17 @@ def _template_items_proportional_editing(*, connected=False):
]
def _template_items_change_frame(params):
if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
return [
("anim.change_frame", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
]
else:
return [
("anim.change_frame", {"type": params.action_mouse, "value": 'PRESS'}, None),
]
# Tool System Templates
def _template_items_tool_select(params, operator, cursor_operator, *, extend):
@ -2073,6 +2084,7 @@ def km_dopesheet(params):
("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
("marker.camera_bind", {"type": 'B', "value": 'PRESS', "ctrl": True}, None),
*_template_items_context_menu("DOPESHEET_MT_context_menu", params.context_menu_event),
*_template_items_change_frame(params),
])
return keymap
@ -2198,6 +2210,7 @@ def km_nla_editor(params):
("marker.add", {"type": 'M', "value": 'PRESS'}, None),
("marker.rename", {"type": 'M', "value": 'PRESS', "ctrl": True}, None),
*_template_items_context_menu("NLA_MT_context_menu", params.context_menu_event),
*_template_items_change_frame(params),
])
return keymap
@ -2930,15 +2943,6 @@ def km_animation(params):
("anim.end_frame_set", {"type": 'END', "value": 'PRESS', "ctrl": True}, None),
])
if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
items.extend([
("anim.change_frame", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
])
else:
items.extend([
("anim.change_frame", {"type": params.action_mouse, "value": 'PRESS'}, None),
])
return keymap
@ -6502,6 +6506,7 @@ def km_sequencer_editor_tool_select(params):
{"items": [
("sequencer.select", {"type": params.select_mouse, "value": 'PRESS'},
{"properties": [("extend", False), ("deselect_all", not params.legacy)]}),
*_template_items_change_frame(params),
]},
)