-
Position of shape layer elements
Hi there!
I have a grid with 120 circles (within a single shape layer) which I want to animate through another layer.
The circles are supposed to check which color is on their exact position on this second layer and change their size accordingly. Black will shrink them to 0%, gray shrinks them to 50% and white will leave them at 100% of their size.
This works not like I want since all individual circles use the same reference point, the position of the layer and not the single element.
Question: How can I change
“samplePoint = transform.position;”
to a behaviour like
“samplePoint = content(“Circle_123″).transform.position;”
without using absolute names like “Circle_123” but something more universal like “this.Element” or “this.Content”?
Or would it be easier if I just place every circle on a different layer with the shape centered on this layer? Until now, I tried to keep the the circles in a single shape layer to have a better overview and be able to change the properties more easily.
sourceLayer = comp("Grid").layer("Gradient");
sampleSize = [1,1];
samplePoint = transform.position;
color= sourceLayer.sampleImage(samplePoint,sampleSize);
x=color[0]*100;
[x,x]