[Bf-blender-cvs] [6fbb4d70516] blender-v3.3-release: Fix T103261: Undo after mask extract doesn't restore active object

Joseph Eagar noreply at git.blender.org
Thu Jan 12 15:54:20 CET 2023


Commit: 6fbb4d70516ef2cf84ae3b07297a749c502abd16
Author: Joseph Eagar
Date:   Sun Dec 18 07:50:35 2022 -0800
Branches: blender-v3.3-release
https://developer.blender.org/rB6fbb4d70516ef2cf84ae3b07297a749c502abd16

Fix T103261: Undo after mask extract doesn't restore active object

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

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

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

diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c b/source/blender/editors/mesh/editmesh_mask_extract.c
index 7634ce6af9e..7ee92d4a5f7 100644
--- a/source/blender/editors/mesh/editmesh_mask_extract.c
+++ b/source/blender/editors/mesh/editmesh_mask_extract.c
@@ -37,6 +37,7 @@
 #include "ED_object.h"
 #include "ED_screen.h"
 #include "ED_sculpt.h"
+#include "ED_undo.h"
 #include "ED_view3d.h"
 
 #include "bmesh_tools.h"
@@ -286,6 +287,16 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op)
   params.add_boundary_loop = RNA_boolean_get(op->ptr, "add_boundary_loop");
   params.apply_shrinkwrap = RNA_boolean_get(op->ptr, "apply_shrinkwrap");
   params.add_solidify = RNA_boolean_get(op->ptr, "add_solidify");
+
+  /* Push an undo step prior to extraction.
+   * Note: A second push happens after the operator due to
+   * the OPTYPE_UNDO flag; having an initial undo step here
+   * is just needed to preserve the active object pointer.
+   * 
+   * Fixes T103261.
+   */
+  ED_undo_push_op(C, op);
+
   return geometry_extract_apply(C, op, geometry_extract_tag_masked_faces, &params);
 }



More information about the Bf-blender-cvs mailing list