diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-03-08 08:57:31 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-03-08 08:57:31 +0400 |
commit | 7461fead506ebac8bf730148e1ace66db116d18a (patch) | |
tree | bfeeb00fece4e1db111f5ff97f467df5a090f881 /source | |
parent | 9e881d0d5b1d4de8189036e2b14344eb2c1afde6 (diff) |
Fix T39035: Cycles F-Modifier truncates end/beginning frame values for repetition
When the keyframes at either end of the source curve don't lie on exact frame boundaries,
this casued problems with the Cycles F-Modifier, as part of the cycle would get chopped
off.
This was caused by float -> integer truncation that was occurring, since one variable
was of the wrong type. The problem here wasn't discovered until now (thanks to gcc's
invalid-type warnings on printf's) as in standard usage, we can safely assume that all
keyframes are strictly on frame boundaries.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/fmodifier.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index bcbc5571077..56b087e7eb6 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -605,7 +605,8 @@ static float fcm_cycles_time(FModifierStackStorage *storage, FCurve *fcu, FModif FMod_Cycles *data = (FMod_Cycles *)fcm->data; float prevkey[2], lastkey[2], cycyofs = 0.0f; short side = 0, mode = 0; - int cycles = 0, ofs = 0; + int cycles = 0; + float ofs = 0; /* check if modifier is first in stack, otherwise disable ourself... */ /* FIXME... */ |