Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to add more than one expression to a single property in Adobe After Effects?

New Here ,
Feb 16, 2021 Feb 16, 2021

I am creating a graph that animates on. Each of my bars is animating on by using trim paths. I have an expression that connects the percentage # and the bar so that the percentage listed matches up to the growth as the bar animates on. I want to add a little bounce to each bar, but I already have one expression added to my trim path which rounds the percentage. When I paste in another expression to add a bounce to the trim paths, it does not work. Can you add more than one expression to a trim path and if so, how do you do so?

TOPICS
Error or problem
3.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 16, 2021 Feb 16, 2021

You don't just add multiple expressions to a property, you refactor the code. That's the whole point. Unless the internal functions are specifically tailored to be "aware" of each other, they won't interact or one expression will override the result of the previous function. that and of course AE has specific limitations in terms of how expressions evaluate or for that matter its general structure. In any case, without seeing your actual setup and code nobody can advise on how to possibly make it cooperate. You have to provide that info by posting screenshots and such.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 17, 2021 Feb 17, 2021
LATEST

Thanks for the explanation. That's exactly the information I was searching for. I thought it was strange that I could watch video after video about adding expressions, but nothing about how to work with more than one. I edited my comment yesterday but it appears that the attachments still didn't make it in. Hopefully, this will work. The two pieces of code I'm working with are the following: 

Rounding to the next number: 

Math.round(value)

Bounce:

amp = 5.0; freq = 2.0; decay = 4.0;

n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) { n--; }
}
if (n == 0) { t = 0; }
else { t = time - key(n).time; }
if (n > 0 && t < 1) {
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*(amp/100)*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}
else { value; };

Screen Shot 2021-02-16 at 6.39.52 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines