Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Getting sourceRectAtTime() for first line in multiline text.

  • Getting sourceRectAtTime() for first line in multiline text.

    Posted by Daniel Annefelt on October 15, 2020 at 8:45 am

    Hello!

    I’m using a sourceRectAtTime() expression to position a bug top-left over a text.

    Kind of like this:

    ®

    CRUSH

    It works as like a charm – the bug stays in place regardless of text length.

    But sometimes I need a 2 (or 3) line text.

    This also works as long as the next line are the same length or shorter.

    Like this:

    ®

    CRUSH

    MUCH

    But if second line is longer obviously the whole text box expands

    and the bug will be positioned according to size of the whole text box.

    Like this:

    ®

    CRUSH

    LOLLAPALOOZA

    But I want this:

    ®

    CRUSH

    LOLLAPALOOZA

    So – question.

    Is there a way to read textbox position info from only the first line in a multiline text?

    cheers!

    .::Daniel

    Daniel Annefelt replied 5 years, 7 months ago 3 Members · 5 Replies
  • 5 Replies
  • Brendon Murphy

    October 15, 2020 at 7:08 pm

    Daniel,

    I can’t really see the issue you’re having… are you able to use the anchor point location or a null to position your bug?

  • Daniel Annefelt

    October 15, 2020 at 9:10 pm

    I have a multiline text.

    I want to lock my graphic layer to the first line.

    Not to the consecutive lines.

  • Filip Vandueren

    October 18, 2020 at 10:14 pm

    I think the easiest would be to have a hidden text-layer that copies all the properties of the first one, but with an expression on sourceText so it only shows the first line.

    (Or you can set it up with a textanimator that sets everything except line 1 to scale 0)

    Then use the sourceRect of that layer.

  • Daniel Annefelt

    October 20, 2020 at 7:50 pm

    Nice!

    Sounds clean and relatively easy.

    Thanx

    .::D

  • Daniel Annefelt

    October 21, 2020 at 8:36 am

    Yes – the scale animator worked!

    Also set the units to Index based on Lines under Advanced.

    Thanks again.

    :::D

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