Commit: ac316a6526c71ff09468ceb288bf6db98c416fe2
Author: mano-wii
Date:   Thu Jan 24 10:20:25 2019 -0200
Branches: master
https://developer.blender.org/rBac316a6526c71ff09468ceb288bf6db98c416fe2

Fix T59423: Mesh deform modifier bind bug causing spiky deformations.

The intersection was being tested between ray and tri, the correct one is 
segment and tri.

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

M       source/blender/editors/armature/meshlaplacian.c

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

diff --git a/source/blender/editors/armature/meshlaplacian.c 
b/source/blender/editors/armature/meshlaplacian.c
index b427843085a..a1f0357d519 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -903,9 +903,10 @@ static void harmonic_ray_callback(void *userdata, int 
index, const BVHTreeRay *r
        face[1] = mdb->cagecos[mloop[lt->tri[1]].v];
        face[2] = mdb->cagecos[mloop[lt->tri[2]].v];
 
-       if (!isect_ray_tri_watertight_v3(
-               ray->origin, ray->isect_precalc, UNPACK3(face), &dist, NULL))
-       {
+       bool isect_ray_tri = isect_ray_tri_watertight_v3(
+               ray->origin, ray->isect_precalc, UNPACK3(face), &dist, NULL);
+
+       if (!isect_ray_tri || dist > isec->vec_length) {
                return;
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to