-
Scale in relation to position in comp
I have found the following expression that adjusts the scale of a layer based on it’s x-position in a comp
But what I need to do is base it’s x-position of a parent comp.
Example:
I have a comp containing a static timeline with icons. As the comp moves along the x-axis in a parent comp then the icons need to scale up and then down as they approach and pass the centre of the parent comp.I am pretty sure that I need to change the layer positioning space somehow but I am really confused in that regard.
Any help would be appreciated.
Chris
offset = 100; //amount to scale up
min = 0; //distance in pixels from the center where the layer is at full scale
max = 300; //distance in pixels from the center where the layer is at 'normal' scale
c = [thisComp.width / 2, thisComp.height / 2]; //center of the composition
p = toComp(anchorPoint); //location of the current layer in the composition
d = Math.abs((p - c)[0]); //distance from the center along the x-axis
x = ease(d, min, max, offset, 0);
value + [x,x,0]