Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to use both inertia and wiggle expression on the same property?

  • How to use both inertia and wiggle expression on the same property?

    Posted by Cory May on March 15, 2018 at 4:55 pm

    I’m working on a lyric video for some friends in a band, and I’m trying to use a wiggle expression on the position of the null the camera is attached to. I also want the camera to bounce a bit when coming to a stop after moving around. I’m assuming that both of these expressions would be used on the null’s position but can’t for the life of me figure out how. Any solutions?

    Edit: I should have specified that I know how to use both the wiggle and inertia expressions, just not sure how to combine them.

    Dan Ebberts replied 8 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 15, 2018 at 5:50 pm

    It would help if you included the expressions in your post.

    Dan

  • Cory May

    March 15, 2018 at 6:02 pm

    Thanks Dan, I’m pretty new to this. This is the inertia expression and I just use a basic wiggle(x,x) expression. I may be going about this all wrong perhaps?

    amp = 5.0; freq = 2.0; decay = 4.0;

    n = 0;
    if (numKeys > 0) {
    n = nearestKey(time).index;
    if (key(n).time > time) { n--; }
    }
    if (n == 0) { t = 0; }
    else { t = time - key(n).time; }
    if (n > 0 && t < 1) {
    v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
    value + v*(amp/100)*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }
    else { value; }

  • Dan Ebberts

    March 15, 2018 at 7:39 pm

    Something like this maybe:


    w = wiggle(1,25) - value;
    amp = 5.0; freq = 2.0; decay = 4.0;

    n = 0;
    if (numKeys > 0) {
    n = nearestKey(time).index;
    if (key(n).time > time) { n--; }
    }
    if (n == 0) { t = 0; }
    else { t = time - key(n).time; }
    if (n > 0 && t < 1) {
    v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
    value + v*(amp/100)*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t) + w;
    }
    else { value + w; }

    Dan

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