Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-10-10 17:13:01 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-10-12 14:57:43 +0300
commitaafd71a8a160bdf44ab3ccea37e88bb90b87a2ac (patch)
treed6782b5d8d26444b6af66e5fa9508b3d174877ab /source/blender/editors/transform/transform_convert_mesh.c
parentab65fe5a2dcca9cb5de14eaeabe5a441bc41f15a (diff)
Fix T81060: CustomData Correction sometimes breaks UVs and Vertex Colors
`CustomData_bmesh_interp` use the same CustomData decryptor (in this case, `bm->ldata`) in both blocks. So make sure that all CustomData layers match. This commit also removes redundant `BM_elem_attrs_copy_ex` calls. Maniphest Tasks: T81060 Differential Revision: https://developer.blender.org/D9159
Diffstat (limited to 'source/blender/editors/transform/transform_convert_mesh.c')
-rw-r--r--source/blender/editors/transform/transform_convert_mesh.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c
index d40a7168af1..f154c8d338e 100644
--- a/source/blender/editors/transform/transform_convert_mesh.c
+++ b/source/blender/editors/transform/transform_convert_mesh.c
@@ -1176,8 +1176,9 @@ static void mesh_customdatacorrect_init_container_generic(TransDataContainer *UN
.use_toolflags = false,
}));
- /* We need to have matching custom-data. */
- BM_mesh_copy_init_customdata(bm_origfaces, bm, NULL);
+ /* We need to have matching loop custom-data. */
+ BM_mesh_copy_init_customdata_all_layers(bm_origfaces, bm, BM_LOOP, NULL);
+
tcld->origfaces = origfaces;
tcld->bm_origfaces = bm_origfaces;
@@ -1359,9 +1360,6 @@ static void mesh_customdatacorrect_apply_vert(struct TransCustomDataLayer *tcld,
* and we do not want to mess up other shape keys */
BM_loop_interp_from_face(bm, l, f_copy, false, false);
- /* make sure face-attributes are correct (e.g. #MLoopUV, #MLoopCol) */
- BM_elem_attrs_copy_ex(tcld->bm_origfaces, bm, f_copy, l->f, BM_ELEM_SELECT, CD_MASK_NORMAL);
-
/* weight the loop */
if (do_loop_weight) {
const float eps = 1.0e-8f;
@@ -1514,8 +1512,6 @@ static void mesh_customdatacorrect_restore(struct TransInfo *t)
BM_elem_attrs_copy(bm_copy, bm, l_copy, l_iter);
l_copy = l_copy->next;
} while ((l_iter = l_iter->next) != l_first);
-
- BM_elem_attrs_copy_ex(bm_copy, bm, f_copy, f, BM_ELEM_SELECT, CD_MASK_NORMAL);
}
}
}