warp modifier, using negative strength inverts the transformation matrix but the...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 1 May 2011 16:07:18 +0000 (16:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 1 May 2011 16:07:18 +0000 (16:07 +0000)
source/blender/modifiers/intern/MOD_warp.c

index 44eea3f93321606bd5b04a11a2d51103f3cad5b3..8825f640c034b4a976ea93e324e7a5dda620510a 100644 (file)
@@ -198,8 +198,14 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob,
        unit_m4(mat_unit);
 
        if(strength < 0.0f) {
+               float loc[3];
                strength = -strength;
+
+               /* inverted location is not useful, just use the negative */
+               copy_v3_v3(loc, mat_final[3]);
                invert_m4(mat_final);
+               negate_v3_v3(mat_final[3], loc);
+
        }
        weight= strength;