## 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 numbe...

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

New Here ,
May 26, 2021 May 26, 2021

Copied

I am getting this error

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

In this expression

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

Report

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

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

2 Replies 2
Enthusiast ,
May 26, 2021 May 26, 2021

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:

Likes

Report

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

Copied

LATEST

Thanks Paul. This did the trick! 🙂

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects