[Bf-blender-cvs] [fff8db3] temp-modifier-deltamush-experimental: Show message when bind data is missing

Campbell Barton noreply at git.blender.org
Tue Mar 31 00:09:21 CEST 2015


Commit: fff8db36922074678b4484a510cbfa97bb02f664
Author: Campbell Barton
Date:   Tue Mar 31 08:35:51 2015 +1100
Branches: temp-modifier-deltamush-experimental
https://developer.blender.org/rBfff8db36922074678b4484a510cbfa97bb02f664

Show message when bind data is missing

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

M	source/blender/modifiers/intern/MOD_correctivesmooth.c

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

diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c
index a8249a3..47b127d 100644
--- a/source/blender/modifiers/intern/MOD_correctivesmooth.c
+++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c
@@ -558,6 +558,7 @@ static void calc_deltas(
 	}
 
 	MEM_freeN(tangent_spaces);
+	MEM_freeN(smooth_vertex_coords);
 }
 
 
@@ -590,13 +591,16 @@ static void correctivesmooth_modifier_do(
 		BLI_assert(csmd->bind_coords != NULL);
 	}
 
-	if (UNLIKELY(use_only_smooth ||
-	             ((csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) && (csmd->bind_coords == NULL))))
-	{
+	if (UNLIKELY(use_only_smooth)) {
 		smooth_verts(csmd, dm, dvert, defgrp_index, vertexCos, numVerts);
 		return;
 	}
 
+	if ((csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) && (csmd->bind_coords == NULL)) {
+		modifier_setError(md, "Bind data required");
+		goto error;
+	}
+
 	/* If the number of verts has changed, the bind is invalid, so we do nothing */
 	if (csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) {
 		if (csmd->bind_coords_num != numVerts) {
@@ -701,6 +705,7 @@ static void correctivesmooth_modifier_do(
 	/* when the modifier fails to execute */
 error:
 	MEM_SAFE_FREE(csmd->delta_cache);
+	csmd->delta_cache_num = 0;
 
 }




More information about the Bf-blender-cvs mailing list