Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Link punctuation layers to text, and then animating with two values

  • Link punctuation layers to text, and then animating with two values

    Posted by Tyler Jack on March 24, 2020 at 2:22 pm

    Hey there.

    I’m animating a quote, where the quotation marks scale up centrally and then animate apart, perfectly landing at the start / end of my linked text layer. I’ve used the following expression (my bounding box matches the size of the text and the quotation marks are set to the left / left + width)

    x=thisComp.layer(“Bounding Box”).sourceRectAtTime(time,true).left +
    thisComp.layer(“Bounding Box”).transform.position[0] +
    thisComp.layer(“Bounding Box”).sourceRectAtTime().width + 16;
    y=thisComp.layer(“Bounding Box”).sourceRectAtTime(time,true).top +
    thisComp.layer(“Bounding Box”).transform.position[1];
    [x,y]

    Is there a way in which this above code can be made as a B value, with an A value as the central 960, 540. I’ve been trying to use

    linear(thisLayer.effect(“Slider Control”)(“Slider”), 0, 100, value, value)

    and then somehow define my two values.

    Any help would be appreciated – even if it it’s to tell me this isn’t possible. I’m working up a template and in an ideal world it would be fully reactive to any changes in the main text layer.

    Thanks,
    TJ

    Tyler Jack replied 6 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    March 26, 2020 at 7:56 am

    I hope I understood you right. But this will only work on one-line texts. Or perfectly justified, because if the last line is shorter, the quote will be at the end of the entire paragraph.

    x=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).left +
    thisComp.layer("Bounding Box").transform.position[0] +
    thisComp.layer("Bounding Box").sourceRectAtTime().width + 16;
    y=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).top +
    thisComp.layer("Bounding Box").transform.position[1];
    B = [x,y];
    A = [960, 540];
    linear(thisLayer.effect("Slider Control")("Slider"), 0, 100, A, B);

    Andrei
    My Envato portfolio.

  • Tyler Jack

    March 26, 2020 at 9:49 am

    Thank you Andrei – this is exactly what I needed. It works perfectly.

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