Fix #138909: Use space_type_set_or_cycle for Ctrl-Tab in Graph Editor

Our keymap, when pressing Ctrl-Tab in Graph Editor, currently changes
the space type to "Dope Sheet" with "wm.context_set_enum". But this
method is not aware of subtypes. This PR instead changes the space type
using "screen.space_type_set_or_cycle". While in Timeline it will go to
Graph Editor, press again to go back to Timeline.  While in Dope Sheet
you go to Graph Editor, press again to go to Dope Sheet.

Pull Request: https://projects.blender.org/blender/blender/pulls/141360
This commit is contained in:
Harley Acheson
2025-07-03 19:32:31 +02:00
committed by Harley Acheson
parent dbd9dc8a71
commit d92523d0b4

View File

@@ -1846,8 +1846,8 @@ def km_graph_editor_generic(params):
{"properties": [("only_active", False)]}),
("anim.channels_select_filter", {"type": 'F', "value": 'PRESS', "ctrl": True}, None),
*_template_items_hide_reveal_actions("graph.hide", "graph.reveal"),
("wm.context_set_enum", {"type": 'TAB', "value": 'PRESS', "ctrl": True},
{"properties": [("data_path", "area.type"), ("value", 'DOPESHEET_EDITOR')]}),
("screen.space_type_set_or_cycle", {"type": 'TAB', "value": 'PRESS', "ctrl": True},
{"properties": [("space_type", 'DOPESHEET_EDITOR')]}),
])
return keymap