Hi,
I have a problem, I have written some python to take a PNG (Shader) from the color channel of a material and place it in the alpha shader channel however when I do this the thumbnail goes grey and the material doesn't render. If I repeat the step manually, no problem.
Any idea? using R23
def main():
# gui.MessageDialog('Hello World!')
doc.GetActiveMaterials()
listOfMat = doc.GetActiveMaterials()
for mat in listOfMat:
print(mat)
shader = mat[c4d.MATERIAL_COLOR_SHADER]
mat[c4d.MATERIAL_LUMINANCE_SHADER] = shader
mat[c4d.MATERIAL_USE_LUMINANCE] = True
mat[c4d.MATERIAL_USE_ALPHA] = True
mat[c4d.MATERIAL_ALPHA_SHADER] = shader
mat[c4d.MATERIAL_USE_COLOR] = False
mat[c4d.MATERIAL_USE_REFLECTION] = False
c4d.EventAdd() # refresh C4D
# update the material
# mat.Message( c4d.MSG_UPDATE )
# mat.Update( True, True )
# Execute main()
if __name__=='__main__':
main()