Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scroll text with scale if/else

  • Scroll text with scale if/else

    Posted by Gus Favoreto on January 27, 2017 at 4:34 pm

    I am breaking my mind to find how and I research here and can’t find the solution. I hope be clear here. ☺

    I have a comp with 700px width, and 5 words align in x. But I want when that words pass between 270px and 400px of this comp scale to 100 them back to 75% when out this position. Ok I did for wich one separately(in this expression I put here), my question is: Can I put a Null and then this 5 words follow this null then they pass between this values they scale?
    My doubt is the value of x position the word is replace of de null, so the null will pass just one time in 270 and 400px.

    Thank you!
    Gus

    p = transform.position[0];

    if(p > 270 && p< 400){
    [100,100];
    }else{
    [75,75];
    }

    Gus Favoreto replied 9 years, 6 months ago 2 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    January 27, 2017 at 5:27 pm

    Try this:


    p = toComp(anchorPoint)[0];
    if (p > 270 && p < 400)
    [100,100]
    else
    [75,75]

    Dan

  • Gus Favoreto

    January 27, 2017 at 6:00 pm

    Dan, you are a genius!!

    This “toComp(anchorPoint)[0]” say to layer look his on anchor point?

    Thanks,
    Gus

  • Dan Ebberts

    January 27, 2017 at 6:08 pm

    toComp() converts from layer space to comp space. A layer’s Anchor Point is always represented in layer space, so that’s what you need to use. You only need to use toComp() if the layer has a parent.

    Dan

  • Gus Favoreto

    January 27, 2017 at 6:10 pm

    Thank you!

  • Gus Favoreto

    January 27, 2017 at 6:12 pm

    Just one more question,

    To scale change smooth, not like a hold keyframe? I need to create a variable to replace the 270?

    Thanks
    Gus

  • Dan Ebberts

    January 27, 2017 at 6:28 pm

    Maybe something more like this:


    pMin = 270;
    pMax = 400;
    pMid = (pMin+pMax)/2;
    p = toComp(anchorPoint)[0];
    if (p < pMid)
    ease(p,pMin,pMid,[75,75],[100,100])
    else
    ease(p,pMid,pMax,[100,100],[75,75])

    Dan

  • Gus Favoreto

    January 27, 2017 at 6:45 pm

    Perfect!

    Thank you again!

    Gus

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