ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to add a specific value to a specific keyframe

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rafael Braz
How to add a specific value to a specific keyframe
on Apr 28, 2018 at 10:18:21 pm

Hi.

So, I have a shape layer which adjusts itself to another text layer.

This expression is under transform shape scale property.

t = thisComp.layer("PERGUNTA");
tRect = t.sourceRectAtTime(time,false);
tUL = t.toComp([tRect.left,tRect.top]);
tLR = t.toComp([tRect.left+tRect.width,tRect.top+tRect.height]);
myRect = sourceRectAtTime(time,false);
myUL = toComp([myRect.left,myRect.top]);
myLR = toComp([myRect.left+myRect.width,myRect.top+myRect.height]);
margin = 50;
[(tLR[0]-tUL[0] + 2*margin)/(myLR[0]-myUL[0]),(tLR[1]-tUL[1]+ 2*margin)/(myLR[1]-myUL[1])]*100


I want this expression to define the properties of the 2nd keyframe as the first is always a 100%/100%.

Can I add a fixed ease between this keyframes or only linear animations?

Thanks in advance.


Return to posts index

Rafael Braz
Re: How to add a specific value to a specific keyframe
on Apr 28, 2018 at 10:27:18 pm

I just tried this as for in and out animations (100%/100% to specific and specific to 100%/100%)

t = thisComp.layer("PERGUNTA");
v1 = key(1).value;
v2 = key(2).value;
tRect = t.sourceRectAtTime(time,false);
tUL = t.toComp([tRect.left,tRect.top]);
tLR = t.toComp([tRect.left+tRect.width,tRect.top+tRect.height]);
myRect = sourceRectAtTime(time,false);
myUL = toComp([myRect.left,myRect.top]);
myLR = toComp([myRect.left+myRect.width,myRect.top+myRect.height]);
margin = 50;
linear(v1,[(tLR[0]-tUL[0] + 2*margin)/(myLR[0]-myUL[0]),(tLR[1]-tUL[1]+ 2*margin)/(myLR[1]-myUL[1])]*100,[(tLR[0]-tUL[0] + 2*margin)/(myLR[0]-myUL[0]),(tLR[1]-tUL[1]+ 2*margin)/(myLR[1]-myUL[1])]*100,v1);


Return to posts index

Rafael Braz
Re: How to add a specific value to a specific keyframe
on May 3, 2018 at 4:23:28 pm

Guys, any hints? Am I tripping on expressions? :(


Return to posts index

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