ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Moving keyframes timing sliders

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
ayoub gharafi
Moving keyframes timing sliders
on May 31, 2020 at 4:33:17 pm

Hey guys I am working on a text animation , that I want to control its offset Timing , basically I have 2 keyframes from -100 to 100 and I want to move them like this k1 to the time t1=inPoint + Duration(Slider) and K2 To t2= t1+Holdtime

I tried this expression By Dan Ebberts;
witch works tremendously for T2 but I cant make the K1 Timing to be exactly at t1=inPoint + Duration(Slider)

Please let me know if there’s any solution

holdTime = effect("Intro")("Slider")*thisComp.frameDuration;
k1 = 1; // 1st hold keyframe
k2 = 2; // 2nd hold keyframe
p =text.animator("Animator 1").selector("Range Selector 1").offset;
t1 = p.key(k1).time;
t2 = t1 + holdTime;
if (time &lt; t1)
t = time
else if (time &lt; t2)
t = linear(time,t1,t2,t1,p.key(k2).time)
else
t = p.key(k2).time + (time - t2);
valueAtTime(t)


Return to posts index

Dan Ebberts
Re: Moving keyframes timing sliders
on May 31, 2020 at 5:44:21 pm

I think it would be something like this:

dur = effect("Duration")("Slider")*thisComp.frameDuration;
holdTime = effect("Hold Time")("Slider")*thisComp.frameDuration;
t1 = inPoint + dur;
t2 = t1 + holdTime;
t = linear(time,t1,t2,key(1).time,key(2).time);
valueAtTime(t)


Dan



Return to posts index

ayoub gharafi
Re: Moving keyframes timing sliders
on May 31, 2020 at 6:03:16 pm

Thanks So much Mr Dan It works perfectly , Also I want to thank you for the fast reply , you’re a legend keep it up


Return to posts index


ayoub gharafi
Re: Moving keyframes timing sliders
on May 31, 2020 at 6:24:39 pm

Hey man thanks again for saving me and please excuse me bothering you againg The expression works perfectly but it doesn't give me the result I wanted so i went with 4 keyframes but this time
The timing in the expression become like this :
and I don’t think the linear expression will cut it this time

t1 = inPoint;
t2 = t1 + holdTime;
t3 = t2+dur;
t4 = t3+holdTime;


Return to posts index

Dan Ebberts
Re: Moving keyframes timing sliders
on May 31, 2020 at 6:33:42 pm

I think it would be like this:


dur = effect("Duration")("Slider")*thisComp.frameDuration;
holdTime = effect("Hold Time")("Slider")*thisComp.frameDuration;
t1 = inPoint;
t2 = t1 + holdTime;
t3 = t2+dur;
t4 = t3+holdTime;
if (time < t2)
t = linear(time,t1,t2,key(1).time,key(2).time)
else if (time <t3)
t = linear(time,t2,t3,key(2).time,key(3).time)
else
t = linear(time,t3,t4,key(3).time,key(4).time);
valueAtTime(t)



Dan



Return to posts index

ayoub gharafi
Re: Moving keyframes timing sliders
on May 31, 2020 at 6:42:06 pm

Man You’re a blessing can't Thank you enough , you just made me want to keep learn about the possibilities in the world of expressions and script , big thanks


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]