[5f59a8bb116] blender2.8: Multi object editing - verticle dissolve support by Mateusz Grzeliński

Dalai Felinto noreply at git.blender.org
Mon May 7 21:50:25 CEST 2018


Commit: 5f59a8bb116dfa27aca21d08318ecf9fea957113
Author: Dalai Felinto
Date:   Mon May 7 21:42:19 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5f59a8bb116dfa27aca21d08318ecf9fea957113

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

===================================================================

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 bb54cd21244..0f43ea4f8f9 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -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);
 
-	EDBM_update_generic(em, true, true);
+	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);
+	}
 
+	MEM_freeN(objects);
 	return OPERATOR_FINISHED;
 }



More information about the Bf-blender-cvs mailing list