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