diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-25 04:02:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-25 04:02:12 +0300 |
commit | 2e112f591413eb8b49595c209298d61fec612476 (patch) | |
tree | da3f2c2ed43eaf574616b301554656a9ad109a65 /source/blender/editors/mesh/editmesh_select.c | |
parent | d8514482fe6b750070270ac886d49d06d28a9a9b (diff) |
Keymap: Use 1..4 to change UV select modes
Support for sync selection switching which keys apply.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_select.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 2e7cf1fc76f..cdb8981801a 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -1462,6 +1462,18 @@ static int edbm_select_mode_exec(bContext *C, wmOperator *op) static int edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event) { + /* Bypass when in UV non sync-select mode, fall through to keymap that edits. */ + if (CTX_wm_space_image(C)) { + ToolSettings *ts = CTX_data_tool_settings(C); + if ((ts->uv_flag & UV_SYNC_SELECTION) == 0) { + return OPERATOR_PASS_THROUGH; + } + /* Bypass when no action is needed. */ + if (!RNA_struct_property_is_set(op->ptr, "type")) { + return OPERATOR_CANCELLED; + } + } + /* detecting these options based on shift/ctrl here is weak, but it's done * to make this work when clicking buttons or menus */ if (!RNA_struct_property_is_set(op->ptr, "use_extend")) |