[Bf-blender-cvs] [73b9e86b499] blender-v2.81-release: EditMesh: avoid undo push on face creation if no action is made

Campbell Barton noreply at git.blender.org
Fri Nov 8 12:16:07 CET 2019


Commit: 73b9e86b49907fcdb04f019ebf6644e8f70c04a1
Author: Campbell Barton
Date:   Fri Nov 8 19:16:27 2019 +1100
Branches: blender-v2.81-release
https://developer.blender.org/rB73b9e86b49907fcdb04f019ebf6644e8f70c04a1

EditMesh: avoid undo push on face creation if no action is made

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

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 a1232347516..eb50babf395 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -930,7 +930,7 @@ static void edbm_add_edge_face_exec__tricky_finalize_sel(BMesh *bm, BMElem *ele_
 static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
 {
   /* when this is used to dissolve we could avoid this, but checking isnt too slow */
-
+  bool changed_multi = false;
   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(
@@ -1005,9 +1005,14 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
     }
 
     EDBM_update_generic(em, true, true);
+    changed_multi = true;
   }
   MEM_freeN(objects);
 
+  if (!changed_multi) {
+    return OPERATOR_CANCELLED;
+  }
+
   return OPERATOR_FINISHED;
 }



More information about the Bf-blender-cvs mailing list