diff options
author | Hans Goudey <h.goudey@me.com> | 2021-02-24 22:08:26 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-02-24 22:08:26 +0300 |
commit | bc0e121bce257a8ea9d7855b074a7a22a8c3699b (patch) | |
tree | 3c4d9735ff8520adf97b9f53cc37fc69e28708b2 | |
parent | 66874824e6ee6e77b783b8867d1b584c25160601 (diff) |
UI: Reorder mesh merge operator types for consistent shortcuts
In vertex selection mode, the "At First" and "At Last" options are
contextually added to the beginning of the list of merge operations.
This means the automatic shortcuts in the merge menu are different,
making learning the shortcuts much more difficult than necessary.
This patch reorders the items so that "At First" and "At Last" are
added after the first three options so the shortcuts are always
consistent.
Fixes T84335
Differential Revision: https://developer.blender.org/D10008
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 231e6fbc2d9..2ea68c3354a 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3261,11 +3261,11 @@ static int edbm_merge_exec(bContext *C, wmOperator *op) } static const EnumPropertyItem merge_type_items[] = { - {MESH_MERGE_FIRST, "FIRST", 0, "At First", ""}, - {MESH_MERGE_LAST, "LAST", 0, "At Last", ""}, {MESH_MERGE_CENTER, "CENTER", 0, "At Center", ""}, {MESH_MERGE_CURSOR, "CURSOR", 0, "At Cursor", ""}, {MESH_MERGE_COLLAPSE, "COLLAPSE", 0, "Collapse", ""}, + {MESH_MERGE_FIRST, "FIRST", 0, "At First", ""}, + {MESH_MERGE_LAST, "LAST", 0, "At Last", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -3284,6 +3284,11 @@ static const EnumPropertyItem *merge_type_itemf(bContext *C, int totitem = 0; BMEditMesh *em = BKE_editmesh_from_object(obedit); + /* Keep these first so that their automatic shortcuts don't change. */ + RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_CENTER); + RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_CURSOR); + RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_COLLAPSE); + /* Only active object supported: * In practice it doesn't make sense to run this operation on non-active meshes * since selecting will activate - we could have own code-path for these but it's a hassle @@ -3305,9 +3310,6 @@ static const EnumPropertyItem *merge_type_itemf(bContext *C, } } - RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_CENTER); - RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_CURSOR); - RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_COLLAPSE); RNA_enum_item_end(&item, &totitem); *r_free = true; |