PDA

View Full Version : MEL: How to check if an image has an alpha channel


sj_bee
03-14-2007, 12:53 PM
Hi people
Does anyone know of a command or a way to query if an image file has an alpha channel or not?

what i want to do is something like:
if (/*THE FILE HAS AN ALPHA CHANNEL*/) connectAttr -f ($fileNode + ".outTransparency") ($lambert + ".transparency");
else //dont do anything
Any ideas?

sparaig
03-14-2007, 02:32 PM
Hi people
Does anyone know of a command or a way to query if an image file has an alpha channel or not?

what i want to do is something like:
if (/*THE FILE HAS AN ALPHA CHANNEL*/) connectAttr -f ($fileNode + ".outTransparency") ($lambert + ".transparency");
else //dont do anything
Any ideas?

Check the fileHasAlpha attribute:

fileHasAlpha (fha) bool false
Is set to true if the file on disk has an alpha channel for which one or more pixels have alpha != 1, false otherwise.

sj_bee
03-14-2007, 04:02 PM
Great thanks a lot thats just what I needed

CGTalk Moderation
03-14-2007, 04:02 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.