ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to get Gradient Ramp to follow text size.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mervin James
Expression to get Gradient Ramp to follow text size.
on Nov 24, 2019 at 7:38:19 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

Scott McGee
Re: Expression to get Gradient Ramp to follow text size.
on Nov 25, 2019 at 8:52:10 am

sourceRectAtTime is what you need

An example, this would be to put one of the anchors (start or end of ramp) in the top right corner.
r = thisLayer.sourceRectAtTime();
[r.left + r.width, r.top]

When you resize or move position. The gradient sticks to the top right corner.

Then apply again to your other anchor (start or end of ramp) to the opposite side and voila.


Return to posts index

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