Skip to main content
d_mancini
Inspiring
Sep 21, 2024 2:10 PM UTC
Answered

Text tracking with a sine shape

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 is closed to new replies. Start a new post to keep the conversation going.
Dan Ebberts
Dan EbbertsCorrect answer
Community Expert
Sep 22, 2024 5:32 PM UTC

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);

 

6 replies

Dan Ebberts
Community Expert
Community Expert
Sep 21, 2024 2:52 PM UTC

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.

 

Translate
d_mancini
d_manciniAuthor
Inspiring
Sep 22, 2024 8:29 AM UTC

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

 

Error: ReferenceError: textTotal is not defined

Translate
Dan Ebberts
Community Expert
Community Expert
Sep 22, 2024 12:38 PM UTC

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

Translate