diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 23:43:57 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 23:43:59 +0300 |
commit | a5f950ed3814b7c09e388a976ec0e5dd325bedd2 (patch) | |
tree | a92b8e8253c49c7bcf06fce6da17387e802ff421 | |
parent | f6b902a9caf3aa05185ea0d0cc4163355629aa39 (diff) |
Fix MESH_OT_loop_select: Deselect object objects
Before that if you loop select a mesh, it would deselect the previous selected
edges of the selected mesh, leaving the other objects untouched.
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 280b8f91151..2da79be2686 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -1782,6 +1782,28 @@ static bool mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool de select_cycle = false; } + if (select_clear) { + ViewLayer *view_layer = CTX_data_view_layer(C); + uint objects_len = 0; + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { + Object *ob_iter = objects[ob_index]; + BMEditMesh *em_iter = BKE_editmesh_from_object(ob_iter); + + if (em_iter->bm->totvertsel == 0) { + continue; + } + + if (em_iter == em) { + continue; + } + + EDBM_flag_disable_all(em_iter, BM_ELEM_SELECT); + DEG_id_tag_update(ob_iter->data, DEG_TAG_SELECT_UPDATE); + } + MEM_freeN(objects); + } + if (em->selectmode & SCE_SELECT_FACE) { mouse_mesh_loop_face(em, eed, select, select_clear); } |