[Bf-blender-cvs] [7461fea] master: Fix T39035: Cycles F-Modifier truncates end/beginning frame values for repetition

Joshua Leung noreply at git.blender.org
Sat Mar 8 05:57:41 CET 2014


Commit: 7461fead506ebac8bf730148e1ace66db116d18a
Author: Joshua Leung
Date:   Sat Mar 8 17:57:31 2014 +1300
https://developer.blender.org/rB7461fead506ebac8bf730148e1ace66db116d18a

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.

===================================================================

M	source/blender/blenkernel/intern/fmodifier.c

===================================================================

diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index bcbc557..56b087e 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... */




More information about the Bf-blender-cvs mailing list