Forum: Poser - OFFICIAL


Subject: Poser Pro changeGamma script not working properly

IsaoShi opened this issue on Dec 13, 2008 · 8 posts


IsaoShi posted Sun, 14 December 2008 at 8:29 AM

This is the part of the script that applies the gamma setting to each material, depending on the selected node types.

I would guess that the problem is with the variable "name" not matching the expected values, but I'm not that clever with Poser Python to know how to check it out. Maybe someone cleverer than me can put their finger on what needs to be done...

def setGammaPerMaterial(mat, newGamma, channel, revert):

shdrTree = mat.ShaderTree(); 

allAboveFlag=0

if (shdrTree):

for node in shdrTree.Nodes():

for input in node.Inputs():

name = input.InternalName()

texture = input.Texture()

if (texture):

if (channel == "All materials"):

changeOneGamma(texture, newGamma, revert)

else:

if (((channel == "Transparency") or (channel == "All of the above")) and (name == "Transparency_Max")):

changeOneGamma(texture, newGamma, revert)

elif (((channel == "Gradient_Bump") or (channel == "All of the above")) and (name == "Gradient_Bump")):

changeOneGamma(texture, newGamma, revert)

elif (((channel == "Displacement") or (channel == "All of the above")) and (name == "Displacement")):

changeOneGamma(texture, newGamma, revert)

elif (((channel == "Bump") or (channel == "All of the above")) and (name == "Bump")):

changeOneGamma(texture, newGamma, revert)

"If I were a shadow, I know I wouldn't like to be half of what I should be."
Mr Otsuka, the old black tomcat in Kafka on the Shore (Haruki Murakami)