Is there a cheap way to make a NodePath or its texture grayscale? I need it for a 2d textured quad used for GUI. setColor() doesn’t seem to do the trick and I wouldn’t want to use PNMImage unless there isn’t a cheaper way.
The only cheap way to do this is to write a custom shader. Otherwise, PNMImage is the way to go.
PNMIMage will do then.
However, I’m having trouble getting the Texture objects. I don’t know its name to use findTexture() and getTexture() returns None on a NodePath with single GeomNode with single Texture. Is there a way to get a list of all the Textures for the NodePath and just use the first one in the list? Or am I just using getTexture() improperly?
You can use findAllTextures() (or findAllTextureStages() for stages) to get a list of all textures applied to the node or any of the nodes below. getTexture only returns the texture applied to the current node, not to the nodes below.