Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Delayed start time of an expression

  • Delayed start time of an expression

    Posted by Chiara Napol on July 6, 2011 at 1:14 pm

    Hi all!
    I’m using this well-known expression 🙂

    freq = 8.0;
    amplitude = 15;
    decay = 4;
    amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time);

    I applied it to the rotation property of one layer in my composition and I need it to start 2 seconds later the “0” frame of the composition… but I noticed it starts at the beginning of the composition and not at the beginning of the layer itself… I’ve been browsing the forum for hours trying to figure out how to do this! I’ve been trying this way…

    timeToStart = 2;
    if (time >= timeToStart){
    t = time - timeToStart;
    freq = 8.0;
    amplitude = 15;
    decay = 4;
    amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time);
    }else{
    0;
    }

    but it is not working 🙁
    I know another possibility could be using a marker, but I couldnt make it work as well!
    Now I’m just looking for the quick&easy way, just writing in the expression in which sec it should start!
    I know this question has been asked again and again, but it’s my very first day handling expressions and my knowledge about coding is really basic! Hope you can help me..

    Thank you!
    Chiara

    Alexander Welsh replied 12 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    July 6, 2011 at 2:06 pm

    in your second expression you are calculating a new time variable (t), but not using that variable in the calculation.

    just change the word ‘time’ to ‘t’ in the calculation:

    amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Chiara Napol

    July 6, 2011 at 2:15 pm

    Thank you!

    Chiara

  • Alexander Welsh

    February 1, 2014 at 12:36 am

    I am dealing with a simple swing expression tied to the x rotation. It starts immediately in the composition, but I’m trying to move it further into the comp. (Specifically, 4:08).

    This has to be something really simple, and all over the internet, but apparently am not typing the right question.

    I’ve toyed with some timeToStart commands, but they just end up cutting off the first portion of the animation and leaving everything after the timeToStart.

    offset = 90;
    swingMaxDistance = 100;
    swingSpeed = 5;
    easeTimeSpan = 2.5;
    easeSpeed = 1;
    easeVal = ease(time*easeSpeed, 0, easeTimeSpan, swingMaxDistance, 0);
    Math.sin(time*swingSpeed) * easeVal;

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