ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to adjust the value of an effect depending on the number of letters

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Finn Hitchcock
Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 6:43:43 pm

​do you know how I could create an expression to -5 FOV (optics compensation) every letter I have. With the FOV starting at 173 with one letter?

Thanks in advance ☺

Dustbinn


Return to posts index

Dan Ebberts
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 7:03:34 pm

Probably something like this:

n = comp("Text").layer("text").text.sourceText.length;
173 - Math.max((n-1),0)*5


Dan



Return to posts index

Finn Hitchcock
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 7:17:20 pm

Hey thanks for helping out!

It's coming up with this error: https://imgur.com/5IifEPF

how could I fix it?


Return to posts index


Dan Ebberts
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 7:25:12 pm

Try it this way:

n = thisLayer.text.sourceText.length;
173 - Math.max((n-1),0)*5


Dan



Return to posts index

Finn Hitchcock
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 7:32:00 pm

Thanks, it's working but I am unable to keyframe it to 0.
Is there a work around?


Return to posts index

Dan Ebberts
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 7:54:44 pm

Under what condition would you want it to be zero?

Dan



Return to posts index


Finn Hitchcock
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 8:29:34 pm

I want it to start at the expression value the keyframe to 0 ( no matter the amount of letters)
I've added this to the expression, am I on the right track?


prop = thisProperty
firstKey = prop.key(1).time;
n = thisLayer.text.sourceText.length;
170 - Math.max((n-1),0)*5

Thanks


Return to posts index

Dan Ebberts
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 8:51:23 pm

You could try something like this:


if (numKeys > 0 && time >= key(1).time){
value
}else{
n = thisLayer.text.sourceText.length;
170 - Math.max((n-1),0)*5;
}



Dan



Return to posts index

Finn Hitchcock
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 9:02:10 pm

It's not changing the value depending on the num of letters now :(


Return to posts index


Dan Ebberts
Re: Expression to adjust the value of an effect depending on the number of letters
on Dec 8, 2019 at 9:08:20 pm

It should, unless the number of letters changes after the first FOV keyframe.


Dan



Return to posts index

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