Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Changing Characters between two selected values

  • Changing Characters between two selected values

    Posted by Dom Brooks on May 9, 2018 at 11:44 am

    So I want to be able to change my text layer containing only one character from “Y” to “N”

    I can obviously do this through key framing the source text but I want a more random effect.

    Then i’d ideally like to link the character value to a colour.

    For example when the source text displays “Y” I would want the fill to be green
    then when the source text displays “N” I would want the fill to be red.

    Does anyone have any idea how to achieve either of these things?

    Kalleheikki Kannisto replied 8 years ago 2 Members · 6 Replies
  • 6 Replies
  • Kalleheikki Kannisto

    May 10, 2018 at 12:00 pm

    A relatively easy approach would be to make a slider control set to zero and add a wiggle to it.

    Use an expression to check the slider value and set the text to “Y” or “N” depending on whether the slider value is above or below zero.

    For color, you can add a tint effect and set the amount to 0 or 100 with an expression depending on the same slider value.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Dom Brooks

    May 10, 2018 at 12:11 pm

    thanks for the response!

    I’m severely inept at expressions at the moment, what would i need to input to set the text to “Y” or “N” depending on whether the slider value is above or below zero? Then, as you’ve said, i can use the same technique to change the colour using a tint.

  • Kalleheikki Kannisto

    May 10, 2018 at 12:32 pm

    Slider wiggle (modify first value for frequency)
    wiggle(2,1)
    Source text
    if (effect("Slider Control")("Slider")<0)"N"else"Y"
    Tint amount
    100*(effect("Slider Control")("Slider")<0)

    That assumes the slider is on the text layer and that the other color is already set in the character settings.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Dom Brooks

    May 10, 2018 at 4:14 pm

    Thanks very much! i’ll let you know if it works!

  • Dom Brooks

    May 15, 2018 at 10:00 am

    Hi

    Just wanted to say your code works great.

    Although one problem i’m facing is that the colours don’t change in time with the source text.

    Would it be another if/else directed at the slider?

  • Kalleheikki Kannisto

    May 15, 2018 at 6:29 pm

    They will be synced, as long as the same slider is referenced with the expressions.

    Kalleheikki Kannisto
    Senior Graphic Designer

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