Activity › Forums › Adobe After Effects Expressions › Expression to adjust the value of an effect depending on the number of letters
-
Expression to adjust the value of an effect depending on the number of letters
Posted by Finn Hitchcock on December 8, 2019 at 6:43 pmdo 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
Dan Ebberts replied 6 years, 9 months ago 2 Members · 9 Replies -
9 Replies
-
Dan Ebberts
December 8, 2019 at 7:03 pmProbably something like this:
n = comp(“Text”).layer(“text”).text.sourceText.length;
173 – Math.max((n-1),0)*5Dan
-
Finn Hitchcock
December 8, 2019 at 7:17 pmHey thanks for helping out!
It’s coming up with this error: https://imgur.com/5IifEPF
how could I fix it?
-
Dan Ebberts
December 8, 2019 at 7:25 pmTry it this way:
n = thisLayer.text.sourceText.length;
173 – Math.max((n-1),0)*5Dan
-
Finn Hitchcock
December 8, 2019 at 7:32 pmThanks, it’s working but I am unable to keyframe it to 0.
Is there a work around? -
Finn Hitchcock
December 8, 2019 at 8:29 pmI 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)*5Thanks
-
Dan Ebberts
December 8, 2019 at 8:51 pmYou 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
-
Finn Hitchcock
December 8, 2019 at 9:02 pmIt’s not changing the value depending on the num of letters now 🙁
-
Dan Ebberts
December 8, 2019 at 9:08 pmIt should, unless the number of letters changes after the first FOV keyframe.
Dan
Reply to this Discussion! Login or Sign Up