Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions layer marker code for bobble head

  • layer marker code for bobble head

    Posted by Jason Zaloga on May 24, 2010 at 5:26 pm

    I got the expression for the head on the y position

    freq = 5;
    amplitude = 35;
    decay = .5;

    y = amplitude*Math.cos(freq*time*2*Math.PI)/Math.exp(decay*time);
    position + [0,y]

    from Dan Ebbert’s jack and the box

    and Laurine Virgilli randomly wiggle wiggle(5,10)

    How can I control both of them with layer markers.

    Jason Zaloga replied 15 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 24, 2010 at 7:59 pm

    Maybe like this:


    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    }
    if (n == 0){
    value
    }else{
    t = time - marker.key(n).time;
    freq = 5;
    amplitude = 35;
    decay = .5;
    w = wiggle(5,10)-value ;
    y = (amplitude*Math.cos(freq*t*2*Math.PI)+w[1])/Math.exp(decay*t);
    x = w[0]/Math.exp(decay*t);
    value + [x,y]
    }

    Dan

  • Jason Zaloga

    May 24, 2010 at 8:32 pm

    holy crap thats fantastic.
    this is a long shot but is there code to have a pendulum swing of another layer follow the motion code you just provided. as if the bobble head has a tassil.

    thanks a bunch.

    thats so awesome, the way it looks.

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