Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Trying to get a lower third template working

  • Trying to get a lower third template working

    Posted by Richard Pizey on February 1, 2021 at 4:22 pm

    Hi all,

    I’m trying to get a lower third template working but not having much luck.

    I have three lines of information, and I’d like my rectangle to change size depending on which field is longer.

    I’ve gotten pretty close with the following expression:

    a = thisComp.layer(“Name”).sourceRectAtTime(0).width+98

    b = thisComp.layer(“Job Title”).sourceRectAtTime(0).width+98

    c = thisComp.layer(“Company Name Further Information”).sourceRectAtTime(0).width+98

    if (a>(b||c)){

    x=a;

    y=7.5;

    [x,y]

    }else{

    x=Math.max(b,c);

    y=7.5;

    [x,y]}

    but it just doesn’t seem to quite work. It seems to only recognise the input of the “name” or “job title” fields.

    I’ve been trying to figure out what I might be missing here, any help massively appreciated!

    Richard Pizey replied 5 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    February 1, 2021 at 4:30 pm

    You are soo close. You won’t need the if statements, just put a Math.max() inside the Math.max():

    x = Math.max( a, Match.max( b, c ) ) ;

  • Kevin Camp

    February 1, 2021 at 4:34 pm

    Actually it looks like you can now have multiple arguments inside Math.max. This works for me:

    x = Math.max( a, b, c ) ;

    I always thought it should work that way : )

  • Richard Pizey

    February 1, 2021 at 4:35 pm

    Kevin, you sir are a scholar and a gentleman.

    I thought I was probably overcomplicating it!

    thanks so much

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