Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Is it possible to create text flags for custom text styles for Motion Graphics Templates?

  • Is it possible to create text flags for custom text styles for Motion Graphics Templates?

  • Clint Porter

    June 16, 2020 at 1:58 pm

    Hi everyone,

    I’ve been making more and more Motion Graphics Templates for my editor coworkers, and I’d love to be able to give them a way to set individual words in bold, italic, or perhaps a custom callout color.

    Is there an expression I can write that would allow me to use some agreed-upon markers in the text string, like perhaps < b >< /b >, and < i >< /i >, to switch out the font or the text fill color?

    Thanks so much!

  • Filip Vandueren

    June 18, 2020 at 8:25 pm

    AFAIK, you can now get and set the style of a text-layer via expressions,
    but you can only set the style of the entire layer, not individual letters/words, ranges.

    Alternatively, you could do faux Bold, faux italic, and colors easily using textAnimators.
    A Bold would be a thicker Stroke on some letters, Italic would be a slight Skew, Fill and Stroke colors can be set with textAnimators too.

    Using some expressions on The sourceText and expression Selectors on those animators, a Frankenstein html-parser can be created, although – of course – it renders horribly slow.

    Here’s something I spitballed together:
    14189_htmlparser.aep.zip

  • Clint Porter

    June 18, 2020 at 8:50 pm

    Wow Filip, that’s really amazing! Nice job on that!

    While I’m really looking forward to the day that After Effects can give Premiere users something more flexible, I think I’ll try to incorporate the color fill code into what I’m making.

    Thanks again! -Clint

  • Victor Ribbs

    July 9, 2020 at 3:34 pm

    Hello,
    this is exactly what I’m looking for but I have a error typeError ranges.toSource is not a function, I populate the text field with a script.
    could you help me ?

  • Filip Vandueren

    July 9, 2020 at 3:36 pm

    This project uses the old Javascript engine.
    Project Settings -> Expressions -> Extendscript Legacy.

    I’ll try and fix it tomorrow, but it’s still just a proof of concept, don’t know if this is production-ready.

  • Filip Vandueren

    July 9, 2020 at 3:49 pm

    ranges.toSource();

    has to become:

    JSON.stringify(ranges);

    and every eval() has to be changed to JSON.parse()

  • Victor Ribbs

    July 9, 2020 at 3:54 pm

    thank-you

    on https://helpx.adobe.com/after-effects/using/legacy-and-extend-script-engine.html
    i have find this

    props.join("\n");
    Returns an array of strings listing the properties and methods available.

  • Victor Ribbs

    July 9, 2020 at 4:04 pm

    thank-you
    it works with your corrections

  • malcolm ricci

    September 19, 2022 at 2:22 pm

    Hey Filip,

    I’ve recently come across this and it works great, so thanks first of all.

    I wanted to ask whether there is anything that I could do to avoid it taking so long to render…

    I’m relatively new to expressions, but from what I’ve understood is it taking so long due to it having to go through every layer on every frame?

    Thanks

  • Filip Vandueren

    September 20, 2022 at 11:17 am

    Hi Malcolm, as you know that solution was just a purely academic excercise to see if I could figure out some way to do it in just 1 layer.

    I’ll see if I can come up with some optimisations, but expressions selectors always seem to bog down after effects. I’ll report back shortly.

Viewing 1 - 10 of 11 posts

Log in to reply.

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