[Bf-blender-cvs] [b72d576f9ff] temp-angavrilov: Mesh Edit: implement X symmetry in the Blend From Shape operator.

Alexander Gavrilov noreply at git.blender.org
Sat Feb 4 21:41:02 CET 2023


Commit: b72d576f9ff83986773801a275e5220b53d5cdba
Author: Alexander Gavrilov
Date:   Sat Feb 4 18:26:46 2023 +0200
Branches: temp-angavrilov
https://developer.blender.org/rBb72d576f9ff83986773801a275e5220b53d5cdba

Mesh Edit: implement X symmetry in the Blend From Shape operator.

===================================================================

M	source/blender/editors/mesh/editmesh_tools.c

===================================================================

diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index edf82382298..412887fee7d 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -3927,6 +3927,14 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op)
     shape = BLI_findindex(&key->block, kb);
 
     if (kb) {
+      const bool use_symmetry = (me->symmetry & ME_SYMMETRY_X) != 0;
+
+      if (use_symmetry) {
+        const bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
+
+        EDBM_verts_mirror_cache_begin(em, 0, false, true, false, use_topology);
+      }
+
       /* Perform blending on selected vertices. */
       BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
         if (!BM_elem_flag_test(eve, BM_ELEM_SELECT) || BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
@@ -3950,6 +3958,12 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op)
           interp_v3_v3v3(eve->co, eve->co, co, blend);
         }
       }
+
+      if (use_symmetry) {
+        EDBM_verts_mirror_apply(em, BM_ELEM_SELECT, 0);
+        EDBM_verts_mirror_cache_end(em);
+      }
+
       EDBM_update(me,
                   &(const struct EDBMUpdate_Params){
                       .calc_looptri = true,



More information about the Bf-blender-cvs mailing list