Copy link to clipboard
Copied
I am getting this error
Error: Argument 1 to SampleImage() must be 2 numbers
In this expression
samplePoint = thisComp.layer("gradient").effect(index+1)("3D Point"); sampleRadius = [10,10]; thisComp.layer("gradient").sampleImage(samplePoint, sampleRadius);
I have seen other tutorials using similar scripts (that don't specify a number), so I don't know how to narrow down the issue. I am not too experienced with scripts so I'm a bit lost here.
Thanks for the help 🙂
To put things in context I am following this tutorial https://www.youtube.com/watch?v=NYueHX4-Zg8
I don't know what effect you're trying to grab the point from but is it perhaps that your '3D Point' is three numbers [X,Y, Z] rather than 2?
In that case you could probably fix it in the last line by packaging the x and y parts back up into an [X, Y] array:
thisComp.layer("gradient").sampleImage([samplePoint[0],samplePoint[1]], sampleRadius);
Copy link to clipboard
Copied
I don't know what effect you're trying to grab the point from but is it perhaps that your '3D Point' is three numbers [X,Y, Z] rather than 2?
In that case you could probably fix it in the last line by packaging the x and y parts back up into an [X, Y] array:
thisComp.layer("gradient").sampleImage([samplePoint[0],samplePoint[1]], sampleRadius);
Copy link to clipboard
Copied
Thanks Paul. This did the trick! 🙂