Multi object editing - verticle dissolve support by Mateusz Grzeliński

With changes by me:
* Indentation (tabs)
* Removing RNA_boolean_get tests out of the for loop.
* Continue iterator if no selected vertice.

Maniphest Tasks: T54643
Differential Revision: https://developer.blender.org/D3210
This commit is contained in:
Dalai Felinto 2018-05-07 21:42:19 +02:00
parent eefaec4114
commit 5f59a8bb11
Notes: blender-bot 2023-02-14 06:00:46 +01:00
Referenced by issue #54643, Multi-Object-Mode: EditMesh Tools
1 changed files with 21 additions and 11 deletions

View File

@ -4766,22 +4766,32 @@ static void edbm_dissolve_prop__use_boundary_tear(wmOperatorType *ot)
static int edbm_dissolve_verts_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BKE_editmesh_from_object(obedit);
const bool use_face_split = RNA_boolean_get(op->ptr, "use_face_split");
const bool use_boundary_tear = RNA_boolean_get(op->ptr, "use_boundary_tear");
if (!EDBM_op_callf(
em, op,
"dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
BM_ELEM_SELECT, use_face_split, use_boundary_tear))
{
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->totvertsel == 0) {
continue;
}
if (!EDBM_op_callf(
em, op,
"dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
BM_ELEM_SELECT, use_face_split, use_boundary_tear))
{
continue;
}
EDBM_update_generic(em, true, true);
}
EDBM_update_generic(em, true, true);
MEM_freeN(objects);
return OPERATOR_FINISHED;
}