Cleanup: move UV element keymap items into a loop
Also add explanation for non-obvious dummy key-map item.
This commit is contained in:
parent
5a3307230e
commit
026a9cdc21
|
@ -278,15 +278,11 @@ def _template_items_uv_select_mode(params):
|
|||
else:
|
||||
return [
|
||||
*_template_items_editmode_mesh_select_mode(params),
|
||||
# Hack to prevent fall-through, when sync select isn't enabled (and the island button isn't visible).
|
||||
("mesh.select_mode", {"type": 'FOUR', "value": 'PRESS'}, None),
|
||||
("wm.context_set_enum", {"type": 'ONE', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'VERTEX')]}),
|
||||
("wm.context_set_enum", {"type": 'TWO', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'EDGE')]}),
|
||||
("wm.context_set_enum", {"type": 'THREE', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'FACE')]}),
|
||||
("wm.context_set_enum", {"type": 'FOUR', "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", 'ISLAND')]}),
|
||||
*(("wm.context_set_enum", {"type": NUMBERS_1[i], "value": 'PRESS'},
|
||||
{"properties": [("data_path", 'tool_settings.uv_select_mode'), ("value", ty)]})
|
||||
for i, ty in enumerate(('VERTEX', 'EDGE', 'FACE', 'ISLAND')))
|
||||
]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue