Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Delay Point path animation

  • Dan Ebberts

    February 7, 2024 at 7:13 pm

    You could try a path expression like this:

    delay = .1;
    p0 = points(time);
    iT0 = inTangents(time);
    oT0 = outTangents(time);
    for (i = 0; i < p0.length; i++){
    p = points(time - i*delay);
    p0[i] = p[i];
    iT = inTangents(time - i*delay);
    iT0[i] = iT[i];
    oT = outTangents(time - i*delay);
    oT0[i] = oT[i];
    }
    createPath(p0,iT0,oT0,isClosed())
  • Dries Van Broeck

    February 8, 2024 at 8:12 am

    Magic! Thanks Dan! Exactly what I needed.

  • Brie Clayton

    February 8, 2024 at 2:14 pm

    Thanks for the solve, Dan!

  • Dan Smith

    April 16, 2025 at 9:16 am

    Hi Dan,

    I tried to create this expression for delayed movement and elasticity of points on a path, combining the elasticity expression with the one based on your reply. However, the result doesn’t seem ideal after running it. Could you help me identify what the issue might be? Thanks a lot!

    By the way, the null layers follow each point on the path, one by one.

     

    var numPoints = points().length;

    var pts = [];

    var delay = effect(“Slide Control”)(“Slider”);

    var nullLayers = [];

    for (var i = 0; i < numPoints; i++) {

    var nl = thisComp.layer(i + 1);

    nullLayers.push(nl ? nl.position : [[0, 0]]);

    }

    var amp = effect(“Elastic”)(1) / 200;

    var freq = effect(“Elastic”)(2) / 30;

    var decay = effect(“Elastic”)(3) / 10;

    for (var i = 0; i < numPoints; i++) {

    var safeTime = Math.max(time – i * framesToTime(delay), 0);

    pts[i] = points(safeTime)[i];

    }

    if (numKeys > 0) {

    var n = nearestKey(time).index;

    if (key(n).time > time) {

    n–;

    }

    if (n > 0) {

    var t = time – key(n).time;

    var baseVel = thisComp.frameDuration / 10;

    for (var i = 0; i < numPoints; i++) {

    try {

    var v = nullLayers[i].velocityAtTime(key(n).time – baseVel) || [0, 0];

    var deltaX = v[0] * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);

    var deltaY = v[1] * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);

    pts[i] = [pts[i][0] + deltaX, pts[i][1] + deltaY];

    } catch (e) {

    }

    }

    }

    }

    createPath(pts, [], [], false);

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