Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions .sourceRectAtTime in combination with keyframes

  • .sourceRectAtTime in combination with keyframes

    Posted by Frank Bemthuis on February 26, 2019 at 10:32 am

    Hi great expressionists (pun intended),
    When having a lower third with a box that has to react to the text + some padding, how can I use the .sourceRectAtTime on only the keyframe’s I want?

    Let’s say I want to animate in the lower box from “nothing” (keyframe 1) to full/the length of text + padding (keyframe 2), and back from that (keyframe 3) to “nothing” (keyframe 4) again?

    How can I script that?
    If someone can give me the go-to expression + some explanation, I would be very thankful ☺


    What I now have is just a simple .sourceRectAtTime with some padding (ofcourse, I want to keep the padding):

    title = thisComp.layer("FUNCTION_txt").sourceRectAtTime();
    [title.width + 26, title.height + 45]

    Anders Hattne replied 7 years, 5 months ago 3 Members · 2 Replies
  • 2 Replies
  • Tomas Bumbulevičius

    March 2, 2019 at 1:05 pm

    Hey Frank,

    could you clarify the following:
    1. What should happen to text when you animate the box?
    2. What box animation you want to apply and for which transformation property?

    This will help to understand what you are trying to achieve fully.

    Thanks.

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.

  • Anders Hattne

    March 2, 2019 at 6:11 pm

    You’d have to change this around.. but could something like this work for you?

    title =thisComp.layer("txt").sourceRectAtTime();
    k1 =thisComp.layer("txt").transform.scale.key(1);
    k2 =thisComp.layer("txt").transform.scale.key(2);

    paddingX= linear(thisComp.layer("txt").transform.scale[0], k1[0], k2[0], 0, 26);
    paddingY= linear(thisComp.layer("txt").transform.scale[1], k1[1], k2[1], 0, 45);

    [title.width + paddingX, title.height + paddingY]

    http://www.ardillamedia.com

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