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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-05-12 09:45:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-05-12 09:47:30 +0300
commit80b1adf8c2e8f76994403ab60a85b9332b58e7fc (patch)
tree4b5ee0ca560c971a6e481e48bdd68b4c1b9727e5 /source/blender/bmesh
parent031715f743cab4a07f673c710739497053d29350 (diff)
BMesh: avoid calling delete operator w/ face dissolve
In nearly all cases this isn't needed.
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/operators/bmo_dissolve.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c
index 52814a82b2f..86062ff0b66 100644
--- a/source/blender/bmesh/operators/bmo_dissolve.c
+++ b/source/blender/bmesh/operators/bmo_dissolve.c
@@ -194,7 +194,10 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
BLI_array_append(faces, NULL);
BLI_array_append(regions, faces);
}
-
+
+ /* track how many faces we should end up with */
+ int totface_target = bm->totface;
+
for (i = 0; i < BLI_array_count(regions); i++) {
BMFace *f_new;
int tot = 0;
@@ -216,6 +219,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
if (act_face && bm->act_face == NULL) {
bm->act_face = f_new;
}
+ totface_target -= tot - 1;
}
else {
BMO_error_raise(bm, op, BMERR_DISSOLVEFACES_FAILED,
@@ -227,11 +231,12 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
* unmark the original faces for deletion */
BMO_elem_flag_disable(bm, f_new, FACE_ORIG);
BMO_elem_flag_enable(bm, f_new, FACE_NEW);
-
}
- BMO_op_callf(bm, op->flag, "delete geom=%ff context=%i", FACE_ORIG, DEL_FACES);
-
+ /* Typically no faces need to be deleted */
+ if (totface_target != bm->totface) {
+ BMO_op_callf(bm, op->flag, "delete geom=%ff context=%i", FACE_ORIG, DEL_FACES);
+ }
if (use_verts) {
BMIter viter;