[Bf-blender-cvs] [207b549d400] blender2.8: Edit Mesh: multi-object edge split support
Campbell Barton
noreply at git.blender.org
Sat Apr 21 22:27:00 CEST 2018
Commit: 207b549d400c005195b045aee4e646f9c04f228c
Author: Campbell Barton
Date: Sat Apr 21 22:18:04 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB207b549d400c005195b045aee4e646f9c04f228c
Edit Mesh: multi-object edge split support
D3161 by @JacquesLucke
===================================================================
M source/blender/editors/mesh/editmesh_tools.c
===================================================================
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);
- }
+ if (em->selectmode == SCE_SELECT_FACE) {
+ EDBM_select_flush(em);
+ }
- EDBM_update_generic(em, true, true);
+ EDBM_update_generic(em, true, true);
+ }
+ MEM_freeN(objects);
return OPERATOR_FINISHED;
}
More information about the Bf-blender-cvs
mailing list