Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions offset an expression by half second or so

  • offset an expression by half second or so

    Posted by Todd Morgan on September 15, 2009 at 2:24 pm

    Hi,

    I have a scripted expression for a scale loop, but I want to offset the loop so that not all my layer objects are looping at the same time. I am an expression-idiot and haven’t had time to figure out the scripting.

    Thanks in advance for any help!

    period = 19;
    maxVal = 105;
    minVal = 100;

    f = 1/(period*thisComp.frameDuration);
    amp = (maxVal - minVal);
    s = amp*(Math.sin(f*time*Math.PI*2 - Math.PI/2) + 1)/2;

    value + [s,s]

    Kevin Camp replied 16 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kevin Camp

    September 15, 2009 at 5:21 pm

    i think this will work

    period = 19;
    maxVal = 105;
    minVal = 100;
    tOffset = .5; // time offset in seconds

    f = 1/(period*thisComp.frameDuration);
    amp = (maxVal - minVal);
    s = amp*(Math.sin(f*(time+tOffset*index)*Math.PI*2 - Math.PI/2) + 1)/2;

    value + [s,s]

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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