On 11/02/2018 at 05:37, xxxxxxxx wrote:
Hi everybody, I'm trying to add an ease-in expression to a rig. I'm not really a math guy, so I'm referencing Penner's equation and in particular this doc: http://upshots.org/actionscript/jsas-understanding-easing.
My code for testing looks like this so far:
import c4d, math
#Welcome to the world of Python
start = 10 #start pos
end = 300 #end pos
d = 50 #duration
def easein(t,d) :
ratio = t/d
print "ratio: ",ratio
return math.pow(ratio,5)
def main() :
t = doc.GetTime().GetFrame(doc.GetFps()) #current frame
factor = easein(t,d)
out_pos = start + (end-start) * factor
print "t: ", t
print "d: ", d
print "factor: ", factor
print "out pos: ", out_pos
but the result of (t/d) is always 0.0. I guess is something with the values type but I can't figure it out.
What am I doing wrong?
Thanks for any advice or help!
cheers
massimiliano