From 5186bb56b583dc9a84b5cb9e9dd22bec269a28c3 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Thu, 16 Jan 2020 17:45:08 +0100 Subject: Fix T71373: Sculpt Mask not extracting correctly on scaled objects This patch applies the original object scale to the coordinates of the extracted mask mesh. Without this patch, the mesh was no taking the original object scale into account and the shrinkwrap will fail. The other solution would be copying the objecty scale to the new extracted mask object, but I would like to avoid entering sculpt mode with scaled objects as it may produce wrong behaviors in some tools. Reviewed By: jbakker Maniphest Tasks: T71373 Differential Revision: https://developer.blender.org/D6207 --- source/blender/editors/mesh/editmesh_mask_extract.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/editors/mesh') diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c b/source/blender/editors/mesh/editmesh_mask_extract.c index 28962c8ec01..139f05db01c 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.c +++ b/source/blender/editors/mesh/editmesh_mask_extract.c @@ -125,6 +125,10 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op) BM_mesh_delete_hflag_context(bm, BM_ELEM_TAG, DEL_FACES); BM_mesh_elem_hflag_disable_all(bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_TAG, false); + BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { + mul_v3_v3(v->co, ob->scale); + } + if (RNA_boolean_get(op->ptr, "add_boundary_loop")) { BM_ITER_MESH (ed, &iter, bm, BM_EDGES_OF_MESH) { BM_elem_flag_set(ed, BM_ELEM_TAG, BM_edge_is_boundary(ed)); -- cgit v1.2.3