Commit: d0ae2624f5e8207ac4d1db0d55d9084ed3e0e2a5
Author: Campbell Barton
Date:   Tue Feb 3 04:26:31 2015 +1100
Branches: master
https://developer.blender.org/rBd0ae2624f5e8207ac4d1db0d55d9084ed3e0e2a5

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);
+                       }
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to