[Bf-blender-cvs] [c51b017a1a1] blender2.8: WeightVG modifiers: Cleanup, add asserts to validate expected data status...

Bastien Montagne noreply at git.blender.org
Tue May 8 12:59:04 CEST 2018


Commit: c51b017a1a12ed1bc9001c2e4e47b14e07f53b53
Author: Bastien Montagne
Date:   Tue May 8 12:58:01 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc51b017a1a12ed1bc9001c2e4e47b14e07f53b53

WeightVG modifiers: Cleanup, add asserts to validate expected data status...

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

M	source/blender/modifiers/intern/MOD_weightvgedit.c
M	source/blender/modifiers/intern/MOD_weightvgmix.c
M	source/blender/modifiers/intern/MOD_weightvgproximity.c

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

diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c
index cc000cbee09..e2b1a491ced 100644
--- a/source/blender/modifiers/intern/MOD_weightvgedit.c
+++ b/source/blender/modifiers/intern/MOD_weightvgedit.c
@@ -155,9 +155,11 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
 }
 
 static Mesh *applyModifier(ModifierData *md,
-                                  const ModifierEvalContext *ctx,
-                                  Mesh *mesh)
+                           const ModifierEvalContext *ctx,
+                           Mesh *mesh)
 {
+	BLI_assert(mesh != NULL);
+
 	WeightVGEditModifierData *wmd = (WeightVGEditModifierData *) md;
 
 	MDeformVert *dvert = NULL;
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c
index 2ea721c1982..0841bc9bfc0 100644
--- a/source/blender/modifiers/intern/MOD_weightvgmix.c
+++ b/source/blender/modifiers/intern/MOD_weightvgmix.c
@@ -204,6 +204,8 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
 
 static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
 {
+	BLI_assert(mesh != NULL);
+
 	WeightVGMixModifierData *wmd = (WeightVGMixModifierData *) md;
 
 	MDeformVert *dvert = NULL;
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index 85d647c3f41..1b5ef23884d 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -41,6 +41,7 @@
 #include "DNA_object_types.h"
 
 #include "BKE_cdderivedmesh.h"
+#include "BKE_curve.h"
 #include "BKE_customdata.h"
 #include "BKE_deform.h"
 #include "BKE_library.h"
@@ -380,6 +381,8 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
 
 static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
 {
+	BLI_assert(mesh != NULL);
+
 	WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData *) md;
 	MDeformVert *dvert = NULL;
 	MDeformWeight **dw, **tdw;
@@ -519,7 +522,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
 			Mesh *target_mesh = get_mesh_eval_for_modifier(obr, ctx->flag);
 
 			/* We must check that we do have a valid target_mesh! */
-			if (target_mesh) {
+			if (target_mesh != NULL) {
 				SpaceTransform loc2trgt;
 				float *dists_v = use_trgt_verts ? MEM_malloc_arrayN(numIdx, sizeof(float), "dists_v") : NULL;
 				float *dists_e = use_trgt_edges ? MEM_malloc_arrayN(numIdx, sizeof(float), "dists_e") : NULL;



More information about the Bf-blender-cvs mailing list