Forums › Adobe After Effects Expressions › Control Text Repeater with sliders
Control Text Repeater with sliders
Fabian Bosman
November 27, 2019 at 9:28 pmDear 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_vertically_horizontally_in/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,
FabianxRepeater = effect("X Repeater")("Slider").value;
yRepeater = effect("Y Repeater")("Slider").value;
horzRepeat = value.repeat(xRepeater);
vertRepeat = horzRepeat + "\n";
vertRepeat = repeat(yRepeater);
How to Repeat Text Vertically & Horizontally in After Effects 2019 from AfterEffects
How to Repeat Text Vertically & Horizontally in After Effects 2019 from AfterEffects
Dan Ebberts
November 27, 2019 at 10:50 pmI think the last line should be:
vertRepeat.repeat(yRepeater);
Dan
Fabian Bosman
November 29, 2019 at 10:45 pmThanks 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
Dan Ebberts
November 29, 2019 at 10:53 pmSure–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
Fabian Bosman
November 29, 2019 at 11:10 pmMan, you know everything ☺ Thank you so much for the help.
It is exactly what I was looking for!Fabian Bosman
December 10, 2019 at 11:01 pmHi 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,
FabianDan Ebberts
December 10, 2019 at 11:11 pmWhat would the result of that look like?
Dan
Fabian Bosman
December 10, 2019 at 11:15 pmSomething 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/b4f79446-4294-479a-bf2a-e559540184a9/23403987.mp4Please let me know your thoughts about how to create this effect.
Greetz
FabianDan Ebberts
December 10, 2019 at 11:36 pmI don’t think you’re going to be able to do anything like that using JavaScript’s string.repeat() function.
Dan
Fabian Bosman
December 11, 2019 at 8:49 amIt 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
Log in to reply.