Multi-Object-Editing : Support for Edge Dissolve by Lucas Boutrot
With minor indentation changes by me. Maniphest Tasks: T54643 Differential Revision: https://developer.blender.org/D3211
This commit is contained in:
parent
5f59a8bb11
commit
7f5c469716
Notes:
blender-bot
2023-02-14 06:00:46 +01:00
Referenced by issue #54643, Multi-Object-Mode: EditMesh Tools
|
@ -4821,21 +4821,32 @@ void MESH_OT_dissolve_verts(wmOperatorType *ot)
|
|||
|
||||
static int edbm_dissolve_edges_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
|
||||
const bool use_verts = RNA_boolean_get(op->ptr, "use_verts");
|
||||
const bool use_face_split = RNA_boolean_get(op->ptr, "use_face_split");
|
||||
|
||||
if (!EDBM_op_callf(
|
||||
em, op,
|
||||
"dissolve_edges edges=%he use_verts=%b use_face_split=%b",
|
||||
BM_ELEM_SELECT, use_verts, use_face_split))
|
||||
{
|
||||
return OPERATOR_CANCELLED;
|
||||
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 *obedit = objects[ob_index];
|
||||
BMEditMesh *em = BKE_editmesh_from_object(obedit);
|
||||
|
||||
if (em->bm->totedgesel == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!EDBM_op_callf(
|
||||
em, op,
|
||||
"dissolve_edges edges=%he use_verts=%b use_face_split=%b",
|
||||
BM_ELEM_SELECT, use_verts, use_face_split))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, true, true);
|
||||
}
|
||||
|
||||
EDBM_update_generic(em, true, true);
|
||||
MEM_freeN(objects);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue