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:
authorBastien Montagne <bastien@blender.org>2021-11-24 18:20:07 +0300
committerBastien Montagne <bastien@blender.org>2021-11-25 12:21:49 +0300
commite6cd4761e7c3043c8e9dc789b6eb6d0aa1b723bd (patch)
treefc7b4e80a020a99caaece96eaee13708339da003 /source/blender/blenkernel/intern/mesh_mirror.c
parent726bc3a46b2fcf6ba36c3e3484b344340f83e53e (diff)
Fix T93321: Modified Mirror modifier behavior break some other tools like bound SurfaceDeform.
Revert "Fix T91444: Edge Loop Preview fails with two Mirror Modifiers" This reverts commit 1a7757b0bc6945ab7d3b281f3e0dd7130bcf80f0. Caused issue reported in T93321, boiling down to the fact that other operations or modifiers (like the SurfaceDeform one) rely on the order of the vertices in the mesh to remain consistent. Changing this in a modifier would mean those operations need to be reset/re-created (e.g. rebound for the SurfaceDeform case), which is not doable in `do_version` code.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_mirror.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_mirror.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/mesh_mirror.c b/source/blender/blenkernel/intern/mesh_mirror.c
index 6df13e71e72..b20d81e7b9c 100644
--- a/source/blender/blenkernel/intern/mesh_mirror.c
+++ b/source/blender/blenkernel/intern/mesh_mirror.c
@@ -260,16 +260,10 @@ 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.
- *
- * 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.
- */
+ /* compare location of the original and mirrored vertex, to see if they
+ * should be mapped for merging */
if (UNLIKELY(len_squared_v3v3(mv_prev->co, mv->co) < tolerance_sq)) {
- *vtmap_b = i;
+ *vtmap_a = maxVerts + i;
tot_vtargetmap++;
/* average location */
@@ -277,11 +271,10 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd,
copy_v3_v3(mv_prev->co, mv->co);
}
else {
- *vtmap_b = -1;
+ *vtmap_a = -1;
}
- /* Fill here to avoid 2x loops. */
- *vtmap_a = -1;
+ *vtmap_b = -1; /* fill here to avoid 2x loops */
vtmap_a++;
vtmap_b++;