Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions have problem with gravity depending on index layer

  • have problem with gravity depending on index layer

    Posted by Tima Tru on August 4, 2012 at 11:26 am

    Hi all!
    How i can pick this expression(gravity) with time depend on index layers.

    y=720*Math.abs(Math.cos(2*time*Math.PI))*Math.exp(-time*0.7);
    position-[0,y]

    When i try pick trig function to time depend on index layer, trig return argument of function from global time.

    I found 2 ways, but it is not working correct:

    //1//
    t = Math.min(Math.floor(time),index);

    y=720*Math.abs(Math.cos(2*time*Math.PI))*t*Math.exp(-time*0.7);
    position-[0,y]

    //

    //2//
    if (time >index){
    y=720*Math.abs(Math.cos(2*time*Math.PI))*t*Math.exp(-time*0.7);}

    position-[0,y]
    //

    Dan Ebberts replied 13 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Tima Tru

    August 4, 2012 at 4:32 pm

    Right decision.

    t=time-n*index;
    if (time>n*index){
    y=720*Math.abs(Math.cos(2*(t)*Math.PI))*Math.exp(-(t)*0.7);
    }
    else{
    y=0
    }
    value-[0,y];

  • Dan Ebberts

    August 4, 2012 at 4:35 pm

    I can’t tell exactly what you’re trying to do, but it might be this:

    t = Math.max(time-index,0);
    y=720*Math.abs(Math.cos(2*t*Math.PI))*t*Math.exp(-t*0.7);
    position-[0,y]

    Dan

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