Edit Mesh: multi-object edge split support

D3161 by @JacquesLucke
This commit is contained in:
2018-04-21 22:18:04 +02:00
parent 5ddcfd2456
commit 207b549d40

View File

@@ -1530,23 +1530,32 @@ void MESH_OT_face_make_planar(wmOperatorType *ot)
static int edbm_edge_split_exec(bContext *C, wmOperator *op) static int edbm_edge_split_exec(bContext *C, wmOperator *op)
{ {
Object *obedit = CTX_data_edit_object(C); ViewLayer *view_layer = CTX_data_view_layer(C);
BMEditMesh *em = BKE_editmesh_from_object(obedit); 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( if (!EDBM_op_call_and_selectf(
em, op, em, op,
"edges.out", false, "edges.out", false,
"split_edges edges=%he", "split_edges edges=%he",
BM_ELEM_SELECT)) BM_ELEM_SELECT))
{ {
return OPERATOR_CANCELLED; continue;
}
if (em->selectmode == SCE_SELECT_FACE) {
EDBM_select_flush(em);
}
EDBM_update_generic(em, true, true);
} }
MEM_freeN(objects);
if (em->selectmode == SCE_SELECT_FACE) {
EDBM_select_flush(em);
}
EDBM_update_generic(em, true, true);
return OPERATOR_FINISHED; return OPERATOR_FINISHED;
} }