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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-05 09:28:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-05 09:28:32 +0400
commite5209c205974b03f1090bf73414a82072a6a0d5b (patch)
tree7fcb8b45cd1f58f33464cbd50326f6bf88dd9e29 /source/blender/modifiers/intern/MOD_weightvgproximity.c
parent2c740a9b5e07faec543d30c85f16f6bbe6fa0c77 (diff)
- vertex group modifiers isDisabled functions were incorrect, need to check if the string is set: == NULL will never be true.
- was doing NULL checks on freeing memory in cases where the values were already accessed (blender would have crashed anyway), so remove the NULL checks. - use deform.c api weight functions to replace inline weight lookups in some cases. - change if checks in weightvg_do_mask() so its more obvious whats going on.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgproximity.c')
-rw-r--r--source/blender/modifiers/intern/MOD_weightvgproximity.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c
index 36f749ab506..513ba9c815f 100644
--- a/source/blender/modifiers/intern/MOD_weightvgproximity.c
+++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c
@@ -327,7 +327,7 @@ static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
{
WeightVGProximityModifierData *wmd = (WeightVGProximityModifierData*) md;
/* If no vertex group, bypass. */
- if (wmd->defgrp_name == NULL) return 1;
+ if (wmd->defgrp_name[0] == '\0') return 1;
/* If no target object, bypass. */
return (wmd->proximity_ob_target == NULL);
}
@@ -505,14 +505,10 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
weightvg_update_vg(dvert, defgrp_idx, numIdx, indices, org_w, 0, 0.0f, 0, 0.0f);
/* Freeing stuff. */
- if (org_w)
- MEM_freeN(org_w);
- if (new_w)
- MEM_freeN(new_w);
- if (indices)
- MEM_freeN(indices);
- if (v_cos)
- MEM_freeN(v_cos);
+ MEM_freeN(org_w);
+ MEM_freeN(new_w);
+ MEM_freeN(indices);
+ MEM_freeN(v_cos);
/* Return the vgroup-modified mesh. */
return ret;