Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-08 13:58:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-08 13:58:48 +0300
commitc51b017a1a12ed1bc9001c2e4e47b14e07f53b53 (patch)
treeb6ba76db8bdaa087fbbf0bdd3291445497b4d862
parent7d9f1a699a987eb7c831f8d45c4f73316b004fb5 (diff)
WeightVG modifiers: Cleanup, add asserts to validate expected data status...
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgedit.c6
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgmix.c2
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c5
3 files changed, 10 insertions, 3 deletions
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;