Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Multiple Position Animation

  • Multiple Position Animation

    Posted by Paul Kamuf on August 16, 2013 at 2:34 pm

    Hi,

    I am looking to move Layer1 to Layer2’s position, but I don’t want it to go directly. I want to have Layer1 move horizontally to a position, then vertically, and then slide into the position occupied by Layer2. Essentially Layer1 is moving to Layer2’s position but going around an obstacle.

    I’m unclear how to use the Interpolation methods for more than 2 points, or if that’s possible? It would also be good to set the start time and duration of this animation.

    Thanks!
    Paul

    Filip Vandueren replied 12 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    August 24, 2013 at 11:54 pm

    I have two shape layers, the first one is called “destination”

    The second one is at a different position.
    The second one has a expression control slider that is keyframed from 0 to 100 to drive the animation.

    This expression on position will first move along the X axis, then the Y axis, to move from the original position to “destination”‘s position.

    You can also use linear() instead of ease()

    p1=position;
    p2=thisComp.layer("destination").position;

    X=Math.abs(p2[0]-p1[0]);
    Y=Math.abs(p2[1]-p1[1]);

    // first X and then Y
    midpoint = 100*(X/(X+Y));
    detour = [p2[0],p1[1]];

    // first Y and then X would be:
    // midpoint = 100*(Y/(X+Y));
    // detour = [p1[0],p2[1]];

    sl=effect("move 0-100")("Slider").value;

    if (sl<midpoint) {
    ease(sl,0,midpoint,p1,detour);
    } else {
    ease(sl,midpoint,100,detour,p2);
    }

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