[Bf-blender-cvs] [3ca8e524086] temp-lanpr-staging: Fix T68684: Vertex snapping with median not working if the object is not at center of the world

mano-wii noreply at git.blender.org
Fri Aug 16 03:04:59 CEST 2019


Commit: 3ca8e5240867210ece71410006ec45cbc6bbc25f
Author: mano-wii
Date:   Thu Aug 15 08:29:34 2019 -0300
Branches: temp-lanpr-staging
https://developer.blender.org/rB3ca8e5240867210ece71410006ec45cbc6bbc25f

Fix T68684: Vertex snapping with median not working if the object is not at center of the world

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

M	source/blender/editors/transform/transform_snap.c

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

diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index d45a0588003..dbcc6c1b04a 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -1150,12 +1150,19 @@ static void TargetSnapMedian(TransInfo *t)
         add_v3_v3(v, td->center);
       }
 
+      if (i == 0) {
+        /* Is this possible? */
+        continue;
+      }
+
+      mul_v3_fl(v, 1.0 / i);
+
       if (tc->use_local_mat) {
         mul_m4_v3(tc->mat, v);
       }
 
       add_v3_v3(t->tsnap.snapTarget, v);
-      i_accum += i;
+      i_accum++;
     }
 
     mul_v3_fl(t->tsnap.snapTarget, 1.0 / i_accum);



More information about the Bf-blender-cvs mailing list