Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position from two layers, plannar positioning

  • Position from two layers, plannar positioning

    Posted by Tim Harris on January 25, 2017 at 3:31 am

    I found a Fusion expression that I would like to know how to implement in Ae if possible.
    It requires two point that can then be used interpolate a 3rd point that is adjustable.
    It would be very useful for tracking.
    The Fusion expression and example can be found here;
    https://www.youtube.com/watch?v=kyaTJmmOmQ8

    Thanks kindly.

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Tim Harris replied 9 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    January 25, 2017 at 6:32 pm

    I’m not sure how you want to implement this in AE, but it might be as simple as an expression like this:

    s = effect(“Slider Control”)(“Slider”);
    a = thisComp.layer(“A”).transform.position;
    b = thisComp.layer(“B”).transform.position;
    linear(s,0,100,a,b)

    Dan

  • Emre Anil

    January 25, 2017 at 8:01 pm

    Setup:

    P3 layer has Slider Control renamed to “weight” and adjusted value to 0 to 1

    Expressions for copy-paste:

    Weight Text – Source Text:

    w = Math.round(thisComp.layer("P3").effect("weight")("Slider") * 100) / 100;
    "w=" + w;

    Weight Text – Position (used anchor point for positioning):

    thisComp.layer("P3").transform.position

    P3 (3rd Point) – Position:

    w = effect("weight")("Slider");
    p1 = thisComp.layer("P1").transform.position;
    p2 = thisComp.layer("P2").transform.position;
    x = ((1 - w) * p1[0]) + (w * p2[0]);
    y = ((1 - w) * p1[1]) + (w * p2[1]);
    [x, y];

    Beam Effect – Starting Point:

    thisComp.layer("P1").transform.position

    Beam Effect – End Point:

    thisComp.layer("P2").transform.position

  • Tim Harris

    January 26, 2017 at 9:01 am

    Emre Anil,

    Thank you so much for taking the time to post your solution, which works perfectly :-).
    This will be very useful.

    Kind Regards,

    Tim

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