-
SampleImage to duplicated layers :0
I am trying to sample an evolving fractal noise layer to get the luminance (lightness?) value of the noise layer directly underneath another layer. I got the idea from Dan Ebbert’s Noise() tutorial here on creativecow
https://library.creativecow.net/articles/ebberts_dan/noise.php
but the problem is really weird. sampleImage() is taking the sample from only one place, so every layer is the same movement. I could have sworn that this would work:
target = effect(“Spectrum Layer”)(“Layer”);
x = transform.position;
area = [width/2,height/2];
s =target.sampleImage([x[0],x[1]],area)
r = rgbToHsl(s);
ease(r[2],0,1,-125,125)which it does, until I turn this on for position:
//Source code courtesy of Dan Ebberts of motionscript.com
numRows = thisComp.layer(“Null 1”).effect(“num Rows”)(“Slider”);
numCols = thisComp.layer(“Null 1”).effect(“Num Columns”)(“Slider”);
row = Math.floor((index – 1)/numCols);
col = (index – 1)%numCols;
x = col*width/(width-thisComp.layer(“Null 1”).effect(“xOverlap”)(“Slider”)/100);
y = row*height/(height-thisComp.layer(“Null 1”).effect(“yOverlap”)(“Slider”)/100);
xOffset = numCols-thisComp.layer(“Null 1”).effect(“xStart”)(“Slider”);
yOffset = numRows-thisComp.layer(“Null 1”).effect(“yStart”)(“Slider”);
z = effect(“output”)(“Slider”);
poz = [x,y,0] + [xOffset,yOffset,z];then it gets weird. I duplicated it a few times, and they all have the same value for the Output from the sampleImage. I thought the result would be it would take the sample from the layers position value, which is different for each layer. I don’t even know where the sample is coming from, it doesn’t match with the fractal noise position or the null in the comp either. How would I fix the sampleImage expression so it will take the sample from the fractal noise layer starting at the grid layer’s centerpoint. I just need to know how to get it to duplicate properly so any help would be great. Thank you!