ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Scroll text with scale if/else

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gus Favoreto
Scroll text with scale if/else
on Jan 27, 2017 at 4:34:01 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&lt; 400){
[100,100];
}else{
[75,75];
}


Return to posts index

Dan Ebberts
Re: Scroll text with scale if/else
on Jan 27, 2017 at 5:27:21 pm

Try this:


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



Dan



Return to posts index

Gus Favoreto
Re: Scroll text with scale if/else
on Jan 27, 2017 at 6:00:45 pm

Dan, you are a genius!!

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

Thanks,
Gus


Return to posts index


Dan Ebberts
Re: Scroll text with scale if/else
on Jan 27, 2017 at 6:08:23 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



Return to posts index

Gus Favoreto
Re: Scroll text with scale if/else
on Jan 27, 2017 at 6:10:12 pm

Thank you!


Return to posts index

Gus Favoreto
Re: Scroll text with scale if/else
on Jan 27, 2017 at 6:12:45 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


Return to posts index


Dan Ebberts
Re: Scroll text with scale if/else
on Jan 27, 2017 at 6:28:37 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



Return to posts index

Gus Favoreto
Re: Scroll text with scale if/else
on Jan 27, 2017 at 6:45:55 pm

Perfect!

Thank you again!

Gus


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]