ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Resize text to match text size of another layer using scale

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Cameron Greenbaum
Resize text to match text size of another layer using scale
on Sep 9, 2019 at 8:57:01 pm

Hey,
I'm trying to resize a text layer using scale to match the size of another text layer. (I'm currently trying to automate a project that is asking for custom animations in multiple languages). I tried using a do while loop but I keep getting the error "Timed out while waiting for engine" or something to that effect. I'm pretty sure it isn't an infinite loop because flipping the inequality gave the same result.

do {
i = 100;
s1 = thisComp.layer("Bottom Line").sourceRectAtTime().width; //the line I'm trying to match
s2 = thisLayer.sourceRectAtTime().width; //the line I'm trying to resize
i + 25;
}while(s1 > s2);
[i]


Return to posts index

Dan Ebberts
Re: Resize text to match text size of another layer using scale
on Sep 10, 2019 at 12:14:11 am

It looks like s1 and and s2 never change, so if s1 is greater than s2, the loop will never end. The only thing that changes in the loop is i, and it's not clear what changing i is supposed to do...


Dan



Return to posts index

Dan Ebberts
Re: Resize text to match text size of another layer using scale
on Sep 10, 2019 at 1:39:37 am

It seems like you'd be looking for something more like this:

s1 = thisComp.layer("Bottom Line").sourceRectAtTime().width; //the line I'm trying to match
s2 = thisLayer.sourceRectAtTime().width;
s = (s1/s2)*100;
[s,s]


Dan



Return to posts index

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