[Bf-blender-cvs] [d20d825] temp_custom_loop_normals: Fix T43524: Warp modifier curve clamped to 0-1

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


Commit: d20d825de4a81874225f8493dd573134e369ea37
Author: Campbell Barton
Date:   Tue Feb 3 04:26:31 2015 +1100
Branches: temp_custom_loop_normals
https://developer.blender.org/rBd20d825de4a81874225f8493dd573134e369ea37

Fix T43524: Warp modifier curve clamped to 0-1

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

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 f6714e7..60ed4be 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -274,27 +274,29 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
 				fac *= texres.tin;
 			}
 
-			/* into the 'from' objects space */
-			mul_m4_v3(mat_from_inv, co);
+			if (fac != 0.0f) {
+				/* into the 'from' objects space */
+				mul_m4_v3(mat_from_inv, co);
 
-			if (fac >= 1.0f) {
-				mul_m4_v3(mat_final, co);
-			}
-			else if (fac > 0.0f) {
-				if (wmd->flag & MOD_WARP_VOLUME_PRESERVE) {
-					/* interpolate the matrix for nicer locations */
-					blend_m4_m4m4(tmat, mat_unit, mat_final, fac);
-					mul_m4_v3(tmat, co);
+				if (fac == 1.0f) {
+					mul_m4_v3(mat_final, co);
 				}
 				else {
-					float tvec[3];
-					mul_v3_m4v3(tvec, mat_final, co);
-					interp_v3_v3v3(co, co, tvec, fac);
+					if (wmd->flag & MOD_WARP_VOLUME_PRESERVE) {
+						/* interpolate the matrix for nicer locations */
+						blend_m4_m4m4(tmat, mat_unit, mat_final, fac);
+						mul_m4_v3(tmat, co);
+					}
+					else {
+						float tvec[3];
+						mul_v3_m4v3(tvec, mat_final, co);
+						interp_v3_v3v3(co, co, tvec, fac);
+					}
 				}
-			}
 
-			/* out of the 'from' objects space */
-			mul_m4_v3(mat_from, co);
+				/* out of the 'from' objects space */
+				mul_m4_v3(mat_from, co);
+			}
 		}
 	}




More information about the Bf-blender-cvs mailing list