Skip to main content
d_mancini
Inspiring
September 21, 2024
Answered

Text tracking with a sine shape

  • September 21, 2024
  • 1 reply
  • 1302 views

Hi,

I’m looking for an expression that, applied to a text layer with a high tracking value (250 for example), will adjust che space between each couple of letters with a sinusoidal shape, with a zero value on left and right and the maximun value at the center. The width of the text box should be retained. It also would be nice to have a parameter to animate the “strength” like in the attached image, that is a simulation of the result I’m looking for.

 

Thanks in advance

This topic has been closed for replies.
Correct answer Dan Ebberts

That’s perfects, thanks again!

Is there a way to animate the strenght of the curve (which corresponds to the difference of spacing between the letters at the ends and the central ones) while mantaining the same width of the paragraph? Like on the image attached to the first post.


You could try adding a slider, and adjust it between 0 and 100, and change the expression to this:

s = effect("Slider Control")("Slider");
tt = Math.max(textTotal-1,1);
a = (textIndex-1)/tt;
v2 = 100*Math.sin(Math.PI*a);
v1 = 63.7;
linear(s,0,100,v1,v2);

 

1 reply

Dan Ebberts
Community Expert
Community Expert
September 21, 2024

I'd start by adding a Tracking Animator, adding an Expression Selector, deleting the Range Selector and using an expression like this for the Expression Selector's Amount property:

tt = Math.max(textTotal-1,1);
a = (textIndex-1)/tt;
100*Math.sin(Math.PI*a)

Then adjust the Animator's Tracking Amount.

 

d_mancini
d_manciniAuthor
Inspiring
September 22, 2024

Thank you Dan, but it doesn’t seem to work:

 

Error: ReferenceError: textTotal is not defined

Dan Ebberts
Community Expert
Community Expert
September 22, 2024

The expression has to go in the Amount property of the Expression Selector. Anywhere else and you will get that error message.