ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Changing Characters between two selected values

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dom Brooks
Changing Characters between two selected values
on May 9, 2018 at 11:44:28 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?


Return to posts index

Kalleheikki Kannisto
Re: Changing Characters between two selected values
on May 10, 2018 at 12:00:26 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


Return to posts index

Dom Brooks
Re: Changing Characters between two selected values
on May 10, 2018 at 12:11:59 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.


Return to posts index


Kalleheikki Kannisto
Re: Changing Characters between two selected values
on May 10, 2018 at 12:32:40 pm
Last Edited By Kalleheikki Kannisto on May 10, 2018 at 12:34:43 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


Return to posts index

Dom Brooks
Re: Changing Characters between two selected values
on May 10, 2018 at 4:14:23 pm

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


Return to posts index

Dom Brooks
Re: Changing Characters between two selected values
on May 15, 2018 at 10:00:51 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?


Return to posts index


Kalleheikki Kannisto
Re: Changing Characters between two selected values
on May 15, 2018 at 6:29:43 pm

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

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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