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.
This commit is contained in:
Dalai Felinto 2018-08-31 17:43:57 -03:00
parent f6b902a9ca
commit a5f950ed38
Notes: blender-bot 2023-02-14 11:34:30 +01:00
Referenced by issue #56684, 2.80 Crashes with 16K HDR Background World Images and Eevee Rendering
Referenced by issue #56647, Key Configuration - Unable to Save
Referenced by issue #56639, [2.8] Crash when overwritting armature pose on Copy/Paste pose with same pose
Referenced by issue #56640, [2.8] Crash when stopping a Cycles render with denoising and nodes.
Referenced by issue #56642, Gizmo orientation problem
Referenced by issue #56643, Crash at Drag&Dropping name on Object Data tab
Referenced by issue #55747, [Crash] Typing ^ character
1 changed files with 22 additions and 0 deletions

View File

@ -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);
}