FORUMS: list search recent posts

Expression to get Gradient Ramp to follow text size.

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mervin James
Expression to get Gradient Ramp to follow text size.
on Nov 24, 2019 at 11:36:29 pm

Hi guys is there an expression to get a gradient ramp effect to adjust to the size of the text. So if the text is shorter or longer then the ramp would adjust to it.
Also is there an expression i can use to get the gradient ramp to follow moving text as currently I can only achieve it with adding a gradient overlay from layer styles and there for I lose the ability to connect the colors to a color control?

Thanks in advance


Return to posts index

Cassius Marques
Re: Expression to get Gradient Ramp to follow text size.
on Nov 25, 2019 at 7:22:41 pm

I guess you only need the answer for the first question. That alone would make it follow the text anyway.

if you mean horizontally then:

start of ramp
L = thisLayer;
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left,0])[0];
y = L.toComp([rect.left,0])[1];
[x,y]


end of ramp
L = thisLayer;
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width,0])[0];
y = L.toComp([rect.left,0])[1];
[x,y]


If you want vertically then:

L = thisLayer;
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width/2,0])[0];
y = L.toComp([rect.height,0])[1];
[x,y]


L = thisLayer;
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width/2,0])[0];
y = L.toComp([rect.height,-150])[1];
[x,y]


This are the results of me messing with code posted by someone (probably Dan) somewhere here. I've used before, its not perfect but it works.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Mervin James
Re: Expression to get Gradient Ramp to follow text size.
on Nov 28, 2019 at 7:31:41 am

Works perfectly 👌👌. Thank you very much for your help. 🙏


Return to posts index

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