First problem, (I'm a noob in Python Maya)
I just want to assign a red blinn to any selected object and have the material named "changed_flag_#"
It's a functioned tied to a GUI button.
Right now, when pressed, it created a red blinn, but doesn't assign it to the object, and then when i hit it again, it creates
another blinn with the correct name, but its not red. It also gives an error. Clearly saying that the object was not selected. But I select the object before I hit the button.
CODE
def flagChanged():
RedBlinn = cmds.shadingNode('blinn', asShader=True, name='Changed_flag*')
#assign new, selected node to selected Geo
cmds.hyperShade(assign=RedBlinn)
cmds.setAttr('Changed_flag*.color', 0.9, 0.08, 0.08, type='double3')
cmds.setAttr('Changed_flag*.reflectivity', 0)
cmds.setAttr('Changed_flag*.specularRollOff', 0.2)
cmds.setAttr('Changed_flag*.eccentricity', 0.12)
ERROR
#Error:No renderable object is selected for assignment
ANY HELP?
M