colorAtPoint problem?

colorAtPoint problem?

Anonymous
Not applicable
249 Views
0 Replies
Message 1 of 1

colorAtPoint problem?

Anonymous
Not applicable
Hi All,

I've been experimenting with the `colorAtPoint` command with a view to eventually using it to sample colour and opacity from an image and building that image in maya using cubes.

But I fear I've run into an early problem.

My idea was I'd sample every pixel in the image for it's alpha value, and build an array of pixels which were opaque, and use this information to choose wich pixels I sample over the image for colour as I don't want/need transparent pixels right now.

So I've run

$alphaCheck = `colorAtPoint -o A -su 8 -sv 8 file1`;


and it's returned something like this - I've formated into a grid so I can visualise it better.


0 1 0 1 1 0 1 0
1 0 1 0 0 1 0 1
0 1 0 1 1 0 1 0
1 0 1 0 0 1 0 1
1 0 1 0 0 1 0 1
0 1 0 1 1 0 1 0
1 0 1 0 0 1 0 1
0 1 0 1 1 0 1 0


The image should be alternating red opaque pixels and white transparent pixels with the first pixel on the top left being red. It's an 8 x 8 image hence the 8 uv samples. It's simply not returning values as I'd expect. I'll attach the image anyway.

Now I might have the wrong end of the stick in assuming maya will sample from the top left, but even still, the double column in the middle there doesn't correspond at all.

Any thoughts or advise on this would be great. Is my methodology wrong? Am I using the command incorrectly?

I'm still pretty new to mel so any constructive criticism would be very helpful.

Thanks

Andy

0 Likes
250 Views
0 Replies
Replies (0)