Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Error: Argument 1 to SampleImage() must be 2 numbers

New Here ,
May 26, 2021 May 26, 2021

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

 

 

Harry Frank shows you how to create the classic Special Presentation logo seen on network TV back in the late 70's and early 80's. To get the effect, he'll d...
TOPICS
Error or problem, Expressions, Scripting

Views

119

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , May 26, 2021 May 26, 2021
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);

Likes

Translate

Translate
Enthusiast ,
May 26, 2021 May 26, 2021

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);

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 26, 2021 May 26, 2021

Copy link to clipboard

Copied

LATEST

Thanks Paul. This did the trick! 🙂 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines