Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Finding the position of a specific character in a text layer

  • Finding the position of a specific character in a text layer

    Posted by Brian Stabile on April 29, 2022 at 9:57 pm

    I am trying to create a trim path on the stroke of a text layer that is editable as text and not shapes, so I can just go in and change the text, and the trim path on the stroke will automatically change with the text.

    The only way I could think to do this is to fake it. I am trying now to create individual layers for each character in the text which I will add a stroke layer style to, pre-comp, and then fake the trim path with an animated mask.

    My trouble is this, I can create a layer for each letter using this:

    nametext = comp(“CHANGE TEXT FOR EFFECT HERE”).layer(“TEST”).text.sourceText;

    nametext.charAt(0);

    But I can’t get the individual characters to align to the character positions in the text layer.

    Is there a way to obtain the position for individual characters in the text layer so I can get my individual character layers X position to match the original text?

    or, failing that, is there a way to get a trim path on a stroke for an editable text layer?

    Filip Vandueren replied 4 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    April 30, 2022 at 11:43 am

    I wrote an animation preset with some expressions that can solve this:

    https://imgur.com/gallery/9oRKx7R

    this version only works on static text, so doesn’t update if the text is also animated by some text animators.

    In this Demo of V2 (which would support text animators, but I’m not willing to release yet) you can see how I did something similar: I mapped an animated emoji layer on top of another character in the text-layer. This can be done with V1 as well

    https://imgur.com/gallery/I7uVARU

    quick demo of v2 of subSourceRect

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy