ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Scale via control layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Mitchell
Scale via control layer
on Feb 21, 2019 at 10:16:59 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.

http://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


Return to posts index

Dan Ebberts
Re: Scale via control layer
on Feb 21, 2019 at 2:11:45 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



Return to posts index

Mark Mitchell
Re: Scale via control layer
on Feb 21, 2019 at 5:10:39 pm

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

Regards

Mark


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]