ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Control Text Repeater with sliders

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Fabian Bosman
Control Text Repeater with sliders
on Nov 27, 2019 at 9:28:04 pm

Dear After Effects Gods.

I was looking for a repeater effect for text.
It is a similar effect to the repeater effect from the shape layer but I still want to be able to adjust my text
instead of making a shape from the text layer first. So I want to control the repeats with two sliders, one for X and one for Y repeats.

I found this video where the technique is explained, but for some reason it is not working in CC2019.
https://www.reddit.com/r/AfterEffects/comments/aw5v1h/how_to_repeat_text_ve...

Below you can find the expression that was used.
Can someone tell me how to get this working in CC2019 and if there is another way to achieve this effect.

I hope someone can help me.

Thanks,
Fabian

xRepeater = effect("X Repeater")("Slider").value;

yRepeater = effect("Y Repeater")("Slider").value;

horzRepeat = value.repeat(xRepeater);

vertRepeat = horzRepeat + "\n";

vertRepeat = repeat(yRepeater);


Return to posts index

Dan Ebberts
Re: Control Text Repeater with sliders
on Nov 27, 2019 at 10:50:33 pm

I think the last line should be:

vertRepeat.repeat(yRepeater);


Dan



Return to posts index

Fabian Bosman
Re: Control Text Repeater with sliders
on Nov 29, 2019 at 10:45:43 pm

Thanks Dan I got it working.

I have another question, is it also possible to have the repeater effect and also
link the source text of the repeater to another text layer?

So when I adjust the text in the other (non repeat) text layer, it will also change the repeater text layer.

I hope it makes sense ☺

Fabian


Return to posts index


Dan Ebberts
Re: Control Text Repeater with sliders
on Nov 29, 2019 at 10:53:54 pm

Sure--something like this:

txt = thisComp.layer("Text").text.sourceText.value;
xRepeater = effect("X Repeater")("Slider").value;
yRepeater = effect("Y Repeater")("Slider").value;
horzRepeat = txt.repeat(xRepeater);
vertRepeat = horzRepeat + "\n";
vertRepeat.repeat(yRepeater);


Dan



Return to posts index

Fabian Bosman
Re: Control Text Repeater with sliders
on Nov 29, 2019 at 11:10:29 pm

Man, you know everything ☺ Thank you so much for the help.
It is exactly what I was looking for!


Return to posts index

Fabian Bosman
Re: Control Text Repeater with sliders
on Dec 10, 2019 at 11:01:05 pm

Hi Dan,

Do you know if it is also possible to use this duplicate effect but then from the middle outwards?
Now it repeats from the top-left corner.

What would be the code for that?
I'm new to the expression language and I'm trying to learn it.

I hope you can help.

Greetz,
Fabian


Return to posts index


Dan Ebberts
Re: Control Text Repeater with sliders
on Dec 10, 2019 at 11:11:53 pm

What would the result of that look like?

Dan



Return to posts index

Fabian Bosman
Re: Control Text Repeater with sliders
on Dec 10, 2019 at 11:15:20 pm

Something similar like this

Around 0:20 sec in the video you see the Line spacing change from the cente to outwards
https://previews.customer.envatousercontent.com/h264-video-previews/b4f7944...

Please let me know your thoughts about how to create this effect.

Greetz
Fabian


Return to posts index

Dan Ebberts
Re: Control Text Repeater with sliders
on Dec 10, 2019 at 11:36:27 pm

I don't think you're going to be able to do anything like that using JavaScript's string.repeat() function.


Dan



Return to posts index


Fabian Bosman
Re: Control Text Repeater with sliders
on Dec 11, 2019 at 8:49:36 am

It doesn't have to be with the string.repeat() function.
If there is another way to repeat text from the middle (center) that would be great too.

I want to achieve the effect in the video I send earlier, and want it to be be working with a slider to easy adjust the repeats.
If this can be done through another way I would like to hear that ☺

Thanks,
Fabian


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]