Cycles FModifier - Repeat Mirrored now works for cycles before the start of the keyframe range
This commit is contained in:
@@ -1774,7 +1774,13 @@ static float fcm_cycles_time (FCurve *fcu, FModifier *fcm, float cvalue, float e
|
|||||||
|
|
||||||
/* calculate where in the cycle we are (overwrite evaltime to reflect this) */
|
/* calculate where in the cycle we are (overwrite evaltime to reflect this) */
|
||||||
if ((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)(cycle) % 2)) {
|
if ((mode == FCM_EXTRAPOLATE_MIRROR) && ((int)(cycle) % 2)) {
|
||||||
/* when 'mirror' option is used and cycle number is odd, this cycle is played in reverse */
|
/* when 'mirror' option is used and cycle number is odd, this cycle is played in reverse
|
||||||
|
* - for 'before' extrapolation, we need to flip in a different way, otherwise values past
|
||||||
|
* then end of the curve get referenced (result of fmod will be negative, and with different phase)
|
||||||
|
*/
|
||||||
|
if (side < 0)
|
||||||
|
evaltime= (float)(prevkey[0] - fmod(evaltime-ofs, cycdx));
|
||||||
|
else
|
||||||
evaltime= (float)(lastkey[0] - fmod(evaltime-ofs, cycdx));
|
evaltime= (float)(lastkey[0] - fmod(evaltime-ofs, cycdx));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user