Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Scale via control layer

  • Scale via control layer

    Posted by Mark Mitchell on February 21, 2019 at 10:16 am

    I am trying to achieve the apple dock effect by using the jjgifford expression but the demo ae doc is too old to open and something isn’t working with the expression in CC2019. Here is the link. I have looked at many examples of how to do this. This seemed to fit if only I can get it to work. Any other suggestions of how this can be achieved are welcome.

    https://jjgifford.com/expressions/geometry/length.html

    // Scale with control layer
    // Applied to scale parameter

    // Point1 is current layer, point2 is control layer
    point1=this_layer.position;
    point2=this_comp.layer("Drag Me").position;

    // Find the vector between the 2 points
    delta=sub(point1, point2);

    // Now find the length
    distance=length(delta);

    //Remap distance to large scale when near, small when far
    linear(distance, 0, 80, [250,250], [75,75]);;

    Regards

    Mark

    Mark Mitchell replied 7 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 21, 2019 at 2:11 pm

    The syntax just needs a little updating:

    // Scale with control layer
    // Applied to scale parameter

    // Point1 is current layer, point2 is control layer
    point1=thisLayer.position;
    point2=thisComp.layer(“Drag Me”).position;

    // Find the vector between the 2 points
    delta=sub(point1, point2);

    // Now find the length
    distance=length(delta);

    //Remap distance to large scale when near, small when far
    linear(distance, 0, 80, [250,250], [75,75]);

    Dan

  • Mark Mitchell

    February 21, 2019 at 5:10 pm

    Hi Dan,
    Thanks that works! Very grateful for your help.

    Regards

    Mark

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