Fix T59423: Mesh deform modifier bind bug causing spiky deformations.
authormano-wii <germano.costa@ig.com.br>
Thu, 24 Jan 2019 12:32:28 +0000 (10:32 -0200)
committermano-wii <germano.costa@ig.com.br>
Thu, 24 Jan 2019 12:32:28 +0000 (10:32 -0200)
Same as rBac316a6526c7.
(I should have commited in 2.7 first and then merged in 2.8).

source/blender/editors/armature/meshlaplacian.c

index 4e31fcc7a11c65460e3bb4e650bdd8de0003ae0e..b42ec77c052b696c0f280938906783ffb9672749 100644 (file)
@@ -898,9 +898,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;
        }