Skip to main content
maestroj50670865
Participant
November 24, 2019
Question

Expression to get Gradient Ramp to follow text size

  • November 24, 2019
  • 2 replies
  • 2109 views

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

This topic has been closed for replies.

2 replies

Community Expert
November 25, 2019

sourceRectAtTime() will give you X and Y dimensions of a text layer. You could use those values to set the starting and ending point of a gradient. You will have to compensate for the text layer's position because that method does not compensate for the layer position. You'll also need to compensate for the gradient layer position.

 

If I saw your comp setup with the modified properties of the layers involved showing (press uu and take a screenshot) I could tell exactly how to tell you how to set up the expression. If you are at all familiar with how expressions and layer and comp space work you should be able to work it out for yourself.

Mylenium
Legend
November 25, 2019

The same sampleImage() and sourceRectAtTime() expressions that people use for adaptive boxes under text layers will be appropriate. Look it up. Making it follow the text would of course also be possible, but depending on how complicated the motions are it may be simpler to just pre-compose the text and move it around.

 

Mylenium