Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to get Gradient Ramp to follow text size.

  • Expression to get Gradient Ramp to follow text size.

    Posted by Mervin James on November 24, 2019 at 7:38 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

    Scott Mcgee replied 6 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Scott Mcgee

    November 25, 2019 at 8:52 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.

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