diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-01-16 19:45:08 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-01-24 20:14:13 +0300 |
commit | 5186bb56b583dc9a84b5cb9e9dd22bec269a28c3 (patch) | |
tree | 33613b25c6fcccc54f7e28873af4784c7a75a46b /source/blender/editors/mesh/editmesh_mask_extract.c | |
parent | 8d3df01e9dc098c3660491e73da9d6901fd422a1 (diff) |
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
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mask_extract.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mask_extract.c | 4 |
1 files changed, 4 insertions, 0 deletions
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)); |