Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text Command to Layer Size Expression

  • Text Command to Layer Size Expression

    Posted by Malcolm Ricci on September 11, 2022 at 10:51 am

    Hey guys,

    I’m creating some parameters for a template to be automated, and I am a little stuck on this;

    I have one text layer (the source text) where the commands Small, Medium or Large could be written.

    This would in turn change the scale of another layer.

    So far, we’ve come up with the following:

    x={getsourcetext}{getsourcetext}
    if (x == “Small”) [80,80]
    else if (x == “Medium”) [90,90]
    else if (x == “Large”) [100,100]

    else [100,100]


    I know that I can tidy this up a little and have the 80, 90 and 100 only written once and then somehow adding the parameters at the end of the expression, but I’m not sure what is missing as if I write it as follows it won’t work:

    x={getsourcetext}
    s=scale
    if (x == “Small”) s=80
    else if (x == “Medium”) s=90
    else if (x == “Large”) s=100
    else 100
    [s,s]

    I’ve also tried the above but with [x,x] at the end instead.

    Could someone guide me as to how to tidy this up a little and write it in a way where I wouldn’t need to write the 80,90 and 100 twice please?

    Thanks!

    Malcolm Ricci replied 3 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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