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

This commit is contained in:
Joseph Eagar 2022-12-18 07:50:35 -08:00
parent 17e266cd55
commit 8666791b2e
Notes: blender-bot 2023-02-14 08:58:01 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #103261, Sculpt: Undo doesn't bring previous stored mesh after calling Mesh extract operation
Referenced by issue #102967, 3.4: Potential candidates for corrective releases
1 changed files with 11 additions and 0 deletions

View File

@ -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"
@ -287,6 +288,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);
}