Updating Attribute Editor or tabs

Hi all, I am trying to update all the tabs of the shaders (in the Attribute Editor) for every new shaders added. I chanced upon this Mel command - updateAE that I gather the information from here

I tried doing a simple test, while I have a few surface shaders in scene, and running the following code:

ssList = cmds.ls(type = 'surfaceShader')

for each in ssList:
    mm.eval("updateAE \"string\" " + each)

But I got the following error instead,

TypeError: cannot concatenate 'str' and 'list' objects

or at times, this error:

RuntimeError: Error occurred during execution of MEL script
Line 1.33: Wrong number of arguments on call to updateAE.

Is this a viable solution else, are there any other similar scripting methods that will enable to update the attribute editor without using maya.api if possible?

Your syntax was off in the MEL statement I believe which gives you the last error. Using the string .format command as shown here is a little cleaner and does better type conversion. Add the two following print statements to see why the variable sometimes contains a list like this:


ssList = cmds.ls(type = 'surfaceShader')

for each in ssList:
    print(each)
    print(type(each))
    mm.eval('updateAE "{0}";'.format(each))

[QUOTE=btribble;24954]Your syntax was off in the MEL statement I believe which gives you the last error. Using the string .format command as shown here is a little cleaner and does better type conversion. Add the two following print statements to see why the variable sometimes contains a list like this:


ssList = cmds.ls(type = 'surfaceShader')

for each in ssList:
    print(each)
    print(type(each))
    mm.eval('updateAE "{0}";'.format(each))

[/QUOTE]

Thanks btribble, I found another similar method but have forgotten to input it here.

Thanks again