Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions How do you force multiple variable text layers to have the exact same start point on the x axis? or sourceRectAtTime with ease animation

  • How do you force multiple variable text layers to have the exact same start point on the x axis? or sourceRectAtTime with ease animation

  • Firuz Daud

    April 29, 2020 at 5:57 pm

    I’m updating my question because no one seems to like it. I think my problem is that text in after effects has slightly different anchor points depending on a lot of things, like the font, the characters, etc. I want them to line up exactly to the pixel on the x axis no matter what is written or what the font is. How would I do that? My original question, example and project are below.

    What I’m trying to do is have a series of text boxes come in from off camera and settle in one line. By using sourceRectAtTime one can paste whatever you want into the box and then the box grows to fit the text. I have that stuff working.

    The start point will always be variable because it depends on how long the line of text is. But I don’t want to use keyframes because I’m working with people who are very unfamiliar with after effects. I just want them to be able to paste their text in and it works. So I’m using an ease expression along with sourceRectAtTime so that the line of text starts minus however many pixels it is. I have that working, but I think it’s wrong. For whatever reason now the stupid boxes don’t line up. I am really bad at this kind of thing. I’ve watched a few tutorials about expressions and sourceRectAtTime but I’m confused about why the text anchor point is always different. Here is a video that illustrates what I want to do and what the problem is.

    https://youtu.be/behVtluit_U?t=27

    And I’m also attaching the project.

    Movement

    s=thisComp.layer("TEXT_1”);
    w=s.sourceRectAtTime().width;
    h=s.sourceRectAtTime().height/2;
    l=s.sourceRectAtTime().left;
    t=s.sourceRectAtTime().top;

    ease (time, inPoint + 0, inPoint + 1.8,[l-(w+50),400], [l+100,400]);

    Anchor point left justified

    a=thisLayer.sourceRectAtTime();

    Height=a.height;
    Width=a.width;
    Top=a.top;
    Left=a.left;

    x=Left;
    y=Top+Height/2;

    [x,y]

    Box Thing
    Size Expression
    s=thisComp.layer("TEXT_1");
    w=s.sourceRectAtTime().width;
    h=s.sourceRectAtTime().height;

    [w+50,h]

    Position Expression
    s=thisComp.layer("TEXT_1");
    w=s.sourceRectAtTime().width/2;
    h=s.sourceRectAtTime().height/2;
    l=s.sourceRectAtTime().left;
    t=s.sourceRectAtTime().top;

    [w+l,h+t]

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Geraldine Green

    May 1, 2020 at 12:58 pm

    Following. Similar issues have come up quite a bit where I work too.

Viewing 1 - 2 of 2 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy