-
[Problem] sampleImage() on a gradient simulate flowing with wind
Hi everyone, I’m having a problem with a personal project where I want to spread a bunch of lavenders as a field and use cc bend it to animate them flowing with the wind, and ofc I don’t want to keyframe all of them so I’m using a sampleImage() expression to sample the brightness of a gradient as the value for bend it.
Now the problem is it all works well in 2d but as soon as I turn the 3D layer switch (of the lavender vectors) on to spread them into a field the sampleImage() stops sampling from the gradient layer as the sample position is tied to the position of the lavender layer.
is there any way I could sample the gradient layer while the lavender layers are 3D ?
I want to make a zoom out from the field and some parralax effect would be great
here’s the expression I used if it helps:
// To sample from the gradient layer sampleLayer = thisComp.layer("Bend controller"); samplePoint = transform.position; sampleSize = [1,1]; colour = sampleLayer.sampleImage(samplePoint,sampleSize); x=colour[0]*100; // To convert the brightness range into a smaller range input = x; inputmin=0; inputmax=100; outputmin=0; outputmax=16; output=linear(input,inputmin,inputmax,outputmin,outputmax); value=outputThanks!!