Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-05-08 10:37:37 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-05-08 10:51:55 +0300
commit848d9cda0eecfdd0bfa6907d1b902ef93f81a463 (patch)
tree499a4302d89078989aeab1271afe132457a76083 /source
parent65e3af35b0c8dc00bd1fe0c51590e6f768f602b4 (diff)
Multi object editing - face dissolve support by Mateusz GrzeliƄski
Maniphest Tasks: T54643 Differential Revision: https://developer.blender.org/D3214
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 82342c4af41..f44c15fbd0a 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -4877,21 +4877,30 @@ void MESH_OT_dissolve_edges(wmOperatorType *ot)
static int edbm_dissolve_faces_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");
+ 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 (!EDBM_op_call_and_selectf(
- em, op,
- "region.out", true,
- "dissolve_faces faces=%hf use_verts=%b",
- BM_ELEM_SELECT, use_verts))
- {
- return OPERATOR_CANCELLED;
- }
+ if (em->bm->totfacesel == 0) {
+ continue;
+ }
- EDBM_update_generic(em, true, true);
+ if (!EDBM_op_call_and_selectf(
+ em, op,
+ "region.out", true,
+ "dissolve_faces faces=%hf use_verts=%b",
+ BM_ELEM_SELECT, use_verts))
+ {
+ continue;
+ }
+
+ EDBM_update_generic(em, true, true);
+ }
+ MEM_freeN(objects);
return OPERATOR_FINISHED;
}