[Bf-blender-cvs] [7283179a002] blender2.8: Poly Build: dissolve was using selection, not highlighted

Campbell Barton noreply at git.blender.org
Mon Sep 10 09:19:50 CEST 2018


Commit: 7283179a002ee01bda843f31a4c5e294e0fcaa28
Author: Campbell Barton
Date:   Mon Sep 10 17:26:22 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB7283179a002ee01bda843f31a4c5e294e0fcaa28

Poly Build: dissolve was using selection, not highlighted

Also no need to clear selection history,
BM_mesh_elem_hflag_disable_all handles this.

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

M	source/blender/editors/mesh/editmesh_polybuild.c

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

diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c
index 617242fa801..14ae6afc7cb 100644
--- a/source/blender/editors/mesh/editmesh_polybuild.c
+++ b/source/blender/editors/mesh/editmesh_polybuild.c
@@ -81,9 +81,6 @@ static void edbm_flag_disable_all_multi(ViewLayer *view_layer, const char hflag)
 		BMesh *bm_iter = em_iter->bm;
 		if (bm_iter->totvertsel) {
 			EDBM_flag_disable_all(em_iter, hflag);
-			if (hflag & BM_ELEM_SELECT) {
-				BM_select_history_clear(em_iter->bm);
-			}
 			DEG_id_tag_update(ob_iter->data, DEG_TAG_SELECT_UPDATE);
 		}
 	}
@@ -429,8 +426,6 @@ static int edbm_polybuild_dissolve_at_cursor_invoke(
 	BMEditMesh *em = vc.em;
 	BMesh *bm = em->bm;
 
-	edbm_selectmode_ensure(vc.scene, vc.em, SCE_SELECT_VERTEX);
-
 	if (ele_act->head.htype == BM_EDGE) {
 		BMEdge *e_act = (BMEdge *)ele_act;
 		BMLoop *l_a, *l_b;
@@ -450,9 +445,14 @@ static int edbm_polybuild_dissolve_at_cursor_invoke(
 		}
 		else {
 			/* too involved to do inline */
+
+			/* Avoid using selection so failure wont leave modified state. */
+			EDBM_flag_disable_all(em, BM_ELEM_TAG);
+			BM_elem_flag_enable(v_act, BM_ELEM_TAG);
+
 			if (!EDBM_op_callf(em, op,
 			                   "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b",
-			                   BM_ELEM_SELECT, false, true))
+			                   BM_ELEM_TAG, false, true))
 			{
 				return OPERATOR_CANCELLED;
 			}



More information about the Bf-blender-cvs mailing list