Fix #27620: improve mesh deform error message when it fails to bind.
[blender.git] / source / blender / editors / armature / meshlaplacian.c
index 40d2d80f2b789925acf4bc49db6ee6ae18107106..502da1be8ac0b6210537542be18dd1b2b5b5c84f 100644 (file)
@@ -1608,7 +1608,7 @@ static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y
                mdb->phi[acenter]= phi/totweight;
 }
 
-static void meshdeform_matrix_solve(MeshDeformBind *mdb)
+static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind *mdb)
 {
        NLContext *context;
        float vec[3], gridvec[3];
@@ -1710,7 +1710,8 @@ static void meshdeform_matrix_solve(MeshDeformBind *mdb)
                        }
                }
                else {
-                       error("Mesh Deform: failed to find solution");
+                       modifier_setError(&mmd->modifier, "Failed to find bind solution (increase precision?).");
+                       error("Mesh Deform: failed to find bind solution.");
                        break;
                }
 
@@ -1819,7 +1820,7 @@ static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierDa
                                meshdeform_check_semibound(mdb, x, y, z);
 
        /* solve */
-       meshdeform_matrix_solve(mdb);
+       meshdeform_matrix_solve(mmd, mdb);
 
        /* assign results */
        if(mmd->flag & MOD_MDEF_DYNAMIC_BIND) {