Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Expression to get Gradient Ramp to follow text size

New Here ,
Nov 24, 2019 Nov 24, 2019

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

TOPICS
Expressions
2.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 25, 2019 Nov 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 25, 2019 Nov 25, 2019
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines