-
Control layer size-changing expression not working correctly
Hello, I’m having some trouble and I’m sure it’s because I’m making some bonehead mistake.
I have a grid of shapes, and I’d like to control their size using a control layer. I’ve done this before in other files. I want them to be basically at 0% scale when the control layer below them is white, and 100% scale when the control layer behind them is black. I’m kinda basing it off this tutorial video: https://www.youtube.com/watch?v=4OQN2mHQuD0&t=554s
Here’s a screenshot of the grid of x’s, with the control layer (Pottery.psd) behind it.

Deeply confused, since this expression has worked perfectly in other files (at least when attached to “rotation” instead of scale), I would love to get someone else’s take on it. I’m not getting error messages, the x’s just aren’t responding in scale to the control layer at all. I don’t know what I’m doing wrong!
The expression I’m adding to the “Scale” attribute on the x’s is below.
sourceLayer = thisComp.layer("Pottery.psd");
sampleSize = [1,1];
samplePoint = transform.position;
color = sourceLayer.sampleImage(sampleSize,samplePoint);
x = color[0]*100;
[x,x]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.