[Bf-blender-cvs] [95a0144293b] master: 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
Thu Aug 15 13:30:21 CEST 2019
Commit: 95a0144293b840bfbdcb6a41c1a3a26976961b9b
Author: mano-wii
Date: Thu Aug 15 08:29:34 2019 -0300
Branches: master
https://developer.blender.org/rB95a0144293b840bfbdcb6a41c1a3a26976961b9b
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