Fix T43524: Warp modifier curve clamped to 0-1

This commit is contained in:
Campbell Barton 2015-02-03 04:26:31 +11:00
parent e224b5b9ca
commit d0ae2624f5
Notes: blender-bot 2023-02-14 09:32:02 +01:00
Referenced by issue #43524, Warp modifier with custom curve is clamped to 0-1
1 changed files with 18 additions and 16 deletions

View File

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