[Bf-blender-cvs] [d27e745] temp_custom_loop_normals: Warp modifier: remove redundant NULL check

Campbell Barton noreply at git.blender.org
Mon Feb 2 20:22:59 CET 2015


Commit: d27e745a2a6dc7825a581f720d8fcdc393512c90
Author: Campbell Barton
Date:   Tue Feb 3 04:38:59 2015 +1100
Branches: temp_custom_loop_normals
https://developer.blender.org/rBd27e745a2a6dc7825a581f720d8fcdc393512c90

Warp modifier: remove redundant NULL check

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

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

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

diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index 9abec80..ed0d18f 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -180,6 +180,9 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
 		return;
 
 	modifier_get_vgroup(ob, dm, wmd->defgrp_name, &dvert, &defgrp_index);
+	if (dvert == NULL) {
+		defgrp_index = -1;
+	}
 
 	if (wmd->curfalloff == NULL) /* should never happen, but bad lib linking could cause it */
 		wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -227,13 +230,11 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
 		     (fac = (wmd->falloff_radius - sqrtf(fac)) / wmd->falloff_radius)))
 		{
 			/* skip if no vert group found */
-			if (dvert && defgrp_index != -1) {
+			if (defgrp_index != -1) {
 				dv = &dvert[i];
-
-				if (dv) {
-					weight = defvert_find_weight(dv, defgrp_index) * strength;
-					if (weight <= 0.0f) /* Should never occure... */
-						continue;
+				weight = defvert_find_weight(dv, defgrp_index) * strength;
+				if (weight <= 0.0f) {
+					continue;
 				}
 			}




More information about the Bf-blender-cvs mailing list