diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 88a4e1d148a..131fb343d0d 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1530,23 +1530,32 @@ void MESH_OT_face_make_planar(wmOperatorType *ot) static int edbm_edge_split_exec(bContext *C, wmOperator *op) { - Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = BKE_editmesh_from_object(obedit); + ViewLayer *view_layer = CTX_data_view_layer(C); + uint objects_len = 0; + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode(view_layer, &objects_len); + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { + Object *obedit = objects[ob_index]; + BMEditMesh *em = BKE_editmesh_from_object(obedit); + if (em->bm->totedgesel == 0) { + continue; + } - if (!EDBM_op_call_and_selectf( - em, op, - "edges.out", false, - "split_edges edges=%he", - BM_ELEM_SELECT)) - { - return OPERATOR_CANCELLED; + if (!EDBM_op_call_and_selectf( + em, op, + "edges.out", false, + "split_edges edges=%he", + BM_ELEM_SELECT)) + { + continue; + } + + if (em->selectmode == SCE_SELECT_FACE) { + EDBM_select_flush(em); + } + + EDBM_update_generic(em, true, true); } - - if (em->selectmode == SCE_SELECT_FACE) { - EDBM_select_flush(em); - } - - EDBM_update_generic(em, true, true); + MEM_freeN(objects); return OPERATOR_FINISHED; }