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
This commit is contained in:
Pablo Dobarro
2020-01-16 17:45:08 +01:00
parent 8d3df01e9d
commit 5186bb56b5

View File

@@ -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));