Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Combining expressions

  • Combining expressions

    Posted by Kim Bee on May 27, 2016 at 6:02 pm

    I have 3 “signs” on top of each other. They all swing down together and swing together but almost independently.

    I am currently using this expression:

    veloc = 7;
    amplitude = 80;
    decay = .7;
    startT = thisLayer.startTime;

    amplitude*Math.cos(veloc*(time-startT))/Math.exp(decay*time)

    to make a sign fall down form X space and swing, then stop… However, I want it to continue to sway slowly afterwards without stopping.

    I found this expression (courtesy of https://www.motionscript.com/expressions-lab-ae65/swinging-light.html)

    amplitude = 7;
    period = 3; //seconds

    amplitude*Math.sin(time*Math.PI*2/period)….

    And it does exactly what I need it to do except the falling down part. I added this to the end of the first code and it swayed after it swung down but it froze the top layer.

    How do I combine both so it falls down, decay, and then slowly sway for the amount of time I choose (i.e. the duration of the composition)?

    Thanks!

    veloc = 7;
    amplitude = 80;
    decay = .7;
    startT = thisLayer.startTime;

    amplitude*Math.cos(veloc*(time-startT))/Math.exp(decay*time)

    amplitude = 7;
    period = 3; //seconds

    amplitude*Math.sin(time*Math.PI*2/period)

    Kim Bee replied 10 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 27, 2016 at 6:42 pm

    The easiest might be to just blend the two expressions over a fixed period (I chose from 4 to 5 seconds for this example):

    veloc = 7;
    amplitude = 80;
    decay = .7;
    startT = thisLayer.startTime;
    v1 = amplitude*Math.cos(veloc*(time-startT))/Math.exp(decay*time);

    amplitude = 7;
    period = 3; //seconds
    v2 = amplitude*Math.sin(time*Math.PI*2/period);

    startEase = 4;
    endEase = 5;
    ease(time,startEase,endEase,v1,v2)

    Dan

  • Kim Bee

    May 27, 2016 at 6:49 pm

    Thank you!!

    That worked perfectly!!

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