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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-11-12 10:35:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-11-12 10:35:19 +0300
commitaa1c44a11348e6e2dcc987bdb7bcdb541d83b631 (patch)
tree77b48321b15e681d838d79a59132faac0058ab05 /source
parent5c0d4753cf1d00b356a83255116e45ec72d66cd0 (diff)
parent1a7757b0bc6945ab7d3b281f3e0dd7130bcf80f0 (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/mesh_mirror.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/mesh_mirror.c b/source/blender/blenkernel/intern/mesh_mirror.c
index b20d81e7b9c..6df13e71e72 100644
--- a/source/blender/blenkernel/intern/mesh_mirror.c
+++ b/source/blender/blenkernel/intern/mesh_mirror.c
@@ -260,10 +260,16 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
mul_m4_v3(mtx, mv->co);
if (do_vtargetmap) {
- /* compare location of the original and mirrored vertex, to see if they
- * should be mapped for merging */
+ /* Compare location of the original and mirrored vertex,
+ * to see if they should be mapped for merging.
+ *
+ * Always merge from the copied into the original vertices so it's possible to
+ * generate a 1:1 mapping by scanning vertices from the beginning of the array
+ * as is done in #BKE_editmesh_vert_coords_when_deformed. Without this,
+ * the coordinates returned will sometimes point to the copied vertex locations, see: T91444.
+ */
if (UNLIKELY(len_squared_v3v3(mv_prev->co, mv->co) < tolerance_sq)) {
- *vtmap_a = maxVerts + i;
+ *vtmap_b = i;
tot_vtargetmap++;
/* average location */
@@ -271,10 +277,11 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
copy_v3_v3(mv_prev->co, mv->co);
}
else {
- *vtmap_a = -1;
+ *vtmap_b = -1;
}
- *vtmap_b = -1; /* fill here to avoid 2x loops */
+ /* Fill here to avoid 2x loops. */
+ *vtmap_a = -1;
vtmap_a++;
vtmap_b++;