diff options
Diffstat (limited to 'source/blender/editors/armature/meshlaplacian.c')
-rw-r--r-- | source/blender/editors/armature/meshlaplacian.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 84b02b4796a..c0600ceed1c 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -41,10 +41,11 @@ #include "BLI_math.h" #include "BLI_edgehash.h" #include "BLI_memarena.h" +#include "BLI_utildefines.h" #include "BKE_DerivedMesh.h" #include "BKE_modifier.h" -#include "BKE_utildefines.h" + #ifdef RIGID_DEFORM #include "BLI_editVert.h" @@ -61,11 +62,11 @@ /* ************* XXX *************** */ -static void waitcursor(int val) {} -static void progress_bar(int dummy_val, const char *dummy) {} -static void start_progress_bar() {} -static void end_progress_bar() {} -static void error(char *str) { printf("error: %s\n", str); } +static void waitcursor(int UNUSED(val)) {} +static void progress_bar(int UNUSED(dummy_val), const char *UNUSED(dummy)) {} +static void start_progress_bar(void) {} +static void end_progress_bar(void) {} +static void error(const char *str) { printf("error: %s\n", str); } /* ************* XXX *************** */ @@ -362,7 +363,7 @@ void laplacian_begin_solve(LaplacianSystem *sys, int index) } } -void laplacian_add_right_hand_side(LaplacianSystem *sys, int v, float value) +void laplacian_add_right_hand_side(LaplacianSystem *UNUSED(sys), int v, float value) { nlRightHandSideAdd(0, v, value); } @@ -398,7 +399,7 @@ typedef struct BVHCallbackUserData { LaplacianSystem *sys; } BVHCallbackUserData; -static void bvh_callback(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) +static void bvh_callback(void *userdata, int index, const BVHTreeRay *UNUSED(ray), BVHTreeRayHit *hit) { BVHCallbackUserData *data = (struct BVHCallbackUserData*)userdata; MFace *mf = data->sys->heat.mface + index; @@ -642,13 +643,15 @@ static float heat_limit_weight(float weight) return weight; } -void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected) +void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, bDeformGroup **dgrouplist, bDeformGroup **dgroupflip, float (*root)[3], float (*tip)[3], int *selected, const char **err_str) { LaplacianSystem *sys; MFace *mface; float solution, weight; int *vertsflipped = NULL, *mask= NULL; - int a, totface, j, bbone, firstsegment, lastsegment, thrownerror = 0; + int a, totface, j, bbone, firstsegment, lastsegment; + + *err_str= NULL; /* count triangles and create mask */ if(me->editflag & ME_EDIT_PAINT_MASK) @@ -759,10 +762,8 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource, } } } - else if(!thrownerror) { - error("Bone Heat Weighting:" - " failed to find solution for one or more bones"); - thrownerror= 1; + else if(*err_str == NULL) { + *err_str= "Bone Heat Weighting: failed to find solution for one or more bones"; break; } @@ -1263,11 +1264,9 @@ static int meshdeform_inside_cage(MeshDeformBind *mdb, float *co) { MDefBoundIsect *isect; float outside[3], start[3], dir[3]; - int i, counter; + int i; for(i=1; i<=6; i++) { - counter = 0; - outside[0] = co[0] + (mdb->max[0] - mdb->min[0] + 1.0f)*MESHDEFORM_OFFSET[i][0]; outside[1] = co[1] + (mdb->max[1] - mdb->min[1] + 1.0f)*MESHDEFORM_OFFSET[i][1]; outside[2] = co[2] + (mdb->max[2] - mdb->min[2] + 1.0f)*MESHDEFORM_OFFSET[i][2]; @@ -1400,7 +1399,7 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb) MEM_freeN(stack); } -static float meshdeform_boundary_phi(MeshDeformBind *mdb, MDefBoundIsect *isect, int cagevert) +static float meshdeform_boundary_phi(MeshDeformBind *UNUSED(mdb), MDefBoundIsect *isect, int cagevert) { int a; @@ -1411,7 +1410,7 @@ static float meshdeform_boundary_phi(MeshDeformBind *mdb, MDefBoundIsect *isect, return 0.0f; } -static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *vec, int cagevert) +static float meshdeform_interp_w(MeshDeformBind *mdb, float *gridvec, float *UNUSED(vec), int UNUSED(cagevert)) { float dvec[3], ivec[3], wx, wy, wz, result=0.0f; float weight, totweight= 0.0f; @@ -1562,7 +1561,7 @@ static void meshdeform_matrix_add_semibound_phi(MeshDeformBind *mdb, int x, int } } -static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y, int z, int cagevert) +static void meshdeform_matrix_add_exterior_phi(MeshDeformBind *mdb, int x, int y, int z, int UNUSED(cagevert)) { float phi, totweight; int i, a, acenter; @@ -1711,7 +1710,7 @@ static void meshdeform_matrix_solve(MeshDeformBind *mdb) nlDeleteContext(context); } -static void harmonic_coordinates_bind(Scene *scene, MeshDeformModifierData *mmd, MeshDeformBind *mdb) +static void harmonic_coordinates_bind(Scene *UNUSED(scene), MeshDeformModifierData *mmd, MeshDeformBind *mdb) { MDefBindInfluence *inf; MDefInfluence *mdinf; |