Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating between two position values with a Slider?

  • Animating between two position values with a Slider?

    Posted by Jordan Montreuil on December 28, 2010 at 8:06 pm

    I am working on a shot that includes the Advanced Lightning effect. The Lightning needs to grow from one point to another. I have the Origin and Direction linked to two separate nulls that are then animated so that they follow the position of objects in the video.

    Is there a way that I can link the Direction parameter to a percentage slider where 0% is the position of one null and 100% is the position of a second null? The ideal result would be being able to animate between the two positions while they themselves are being animating to follow some video.

    Dan Ebberts replied 11 years, 5 months ago 4 Members · 4 Replies
  • 4 Replies
  • Chris Wright

    December 28, 2010 at 9:41 pm

    if you want it variably controlled, I don’t see why a linear wouldn’t work.
    //paste in direction and slider will control balance between 2 nulls.

    s = effect(“Slider Control”)(“Slider”);
    x=thisComp.layer(“Null 1”).transform.position;
    y=thisComp.layer(“Null 2”).transform.position;

    n1=x[0];
    n2=x[1];

    n3=y[0];
    n4=y[1];

    s1=linear(s, 0,100, n1, n3);
    s2=linear(s, 0,100, n2, n4);

    [s1,s2];

    //you can also add wiggle in slider if you want.

    https://technicolorsoftware.hostzi.com/

  • Jordan Montreuil

    December 29, 2010 at 8:35 pm

    Beautiful. If I could email you a cookie, I would.

  • Marco Polman

    December 15, 2014 at 5:42 pm

    How would you utilize this in a 3D environment? I tried modifying the expression a few different ways but wasn’t able to get it to work.

    Thanks!

  • Dan Ebberts

    December 15, 2014 at 7:06 pm

    This should work:

    s = effect(“Slider Control”)(“Slider”);
    p1=thisComp.layer(“Null 1”).transform.position;
    p2=thisComp.layer(“Null 2”).transform.position;
    linear(s,0,100,p1,p2)

    Dan

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