Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animated round lower third

  • Animated round lower third

    Posted by Justin Lundy on April 29, 2024 at 3:23 pm

    I’m creating a lower third that dynamically resizes based on the person’s name and I’ve added a checkbox expression to allow users to change between a rectangle and a rounded rectangle. To animate in, I simply scaled the box on the X axis. It works great for just the rectangle, but when it is a rounded rectangle, it starts out with 90 degree angles and rounds out as it scales in. I tried converting it to a bezier path, but since that creates an actual path, I can’t connect the path shape to the size of the text layer. Is there a workaround?

    I attached an mp4 of the animation for re

    Brie Clayton replied 2 years, 2 months ago 3 Members · 12 Replies
  • 12 Replies
  • Dan Ebberts

    April 29, 2024 at 3:33 pm

    Have you thought about animating the x value of the rectangle’s size, rather than the scale?

  • Justin Lundy

    April 29, 2024 at 5:19 pm

    Thanks for the reply, Dan!

    I currently have the following expression in the rectangle’s size property connecting the X value to the width of the text layer:

    “var s = thisComp.layer(“Text”);

    var start = s.inPoint;

    var end = s.outPoint;

    var mid = (end-start)/2;

    var w = s.sourceRectAtTime(mid).width;

    var h = s.sourceRectAtTime(mid).height;

    [w,h];”

    I removed the “mid” from the X sourceRectAtTime and added “+value” after the “[w,h];” and that lets me keyframe the animation, but breaks the dynamic resizing of the text box, which would be fine, but the goal of this is to export these as a MOGRT and have the size of the text box dynamically resize based on whomever’s name is put in the text field. It’s also animating in from the center rather than from the left despite the shape’s anchor point being on the left.

  • Dan Ebberts

    April 29, 2024 at 6:53 pm

    I think you could get there, if you animated the rectangle’s size between [0,h] and [w,h] and also animate the rectangle’s position offset between [-w/2,0] and [0,0]. I could probably be more specific if I knew what was driving the timing of your animation.

  • Justin Lundy

    April 29, 2024 at 6:56 pm

    Would it be helpful if I upload a version of the AE project? There’s no linked files, only native shapes and text.

  • Dan Ebberts

    April 29, 2024 at 7:06 pm

    Absolutely.

  • Justin Lundy

    April 29, 2024 at 7:13 pm

    Awesome! It is attached. Thanks for taking a look and helping me out.

  • Dan Ebberts

    April 29, 2024 at 7:43 pm

    That’s more complex than I anticipated. I still can’t figure out what drives the timing of the rectangle’s animation, but assuming you know, I think you can just adjust the size expression for the rectangle like this:

    var s = thisComp.layer("Justin RenegadeofFunk Lundy");
    var start = s.inPoint;
    var end = s.outPoint;
    var mid = (end-start)/2;
    var w = s.sourceRectAtTime(mid).width;
    var h = s.sourceRectAtTime(mid).height;
    var endVal = [w,h];
    var startVal = [0,h];
    var startAnim = ??
    var endAnim = ??
    linear(time,startAnim,endAnim,startVal,endVal)

    and the position expression for the rectangle like this:

    var s = thisComp.layer("Justin RenegadeofFunk Lundy");
    var start = s.inPoint;
    var end = s.outPoint;
    var mid = (end-start)/2;
    var w = s.sourceRectAtTime(mid).width/2;
    var h = s.sourceRectAtTime(mid).height/2;
    var l = s.sourceRectAtTime(mid).left;
    var t = s.sourceRectAtTime(mid).top;
    endVal = [w+l,h+t];
    startVal = endVal - [w,0];
    var startAnim = ??
    var endAnim = ??
    linear(time,startAnim,endAnim,startVal,endVal)

    although (based on the video you posted) you may want a custom easing rather than linear(), which may add another level of complexity.

  • Justin Lundy

    April 29, 2024 at 7:53 pm

    Sweet. Thank you!

    The text animation is just a preset animation in the effects panel.

    What do I put in the fields with question marks?

  • Dan Ebberts

    April 29, 2024 at 8:00 pm

    I just put those in to represent the start and end times of the rectangle’s animation. Not sure if you would pick those up off of keyframes, or somewhere else (probably whatever was driving your scale animation).

  • Justin Lundy

    April 29, 2024 at 8:07 pm

    Gotcha. Thank you so much! I’ll play around with some simpler text animation that play nicer with those expressions.

Page 1 of 2

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