First of all I use python in maya, but I don't think python is the problem here.
What I want to do is looping trough a list generated from the materials in the hypershade. All of those materials need to have a diffusevalue of 1. But when I code this:
import maya.cmds as cmds
DefaultMaterials = cmds.itemFilter(byType='phong')
textureNodeList = cmds.lsThroughFilter(DefaultMaterials, na=True, sort='byName', rv=False)
for node in textureNodeList :
attrList = cmds.listAttr(node)
I get the message: "
# Error: 'unicode' object has no attribute 'diffuse'
# Traceback (most recent call last):
# File "<maya console>", line 13, in ?
# AttributeError: 'unicode' object has no attribute 'diffuse' #"
When I print the attrList I get all the attributes of the nodes, one of them is the diffuse attribute...
What am I doing wrong ?
Thanks for the help.