0

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 / functions that will enable to update the attribute editor?

dissidia
  • 1,531
  • 3
  • 23
  • 53
  • The error you get says that `ssList` contains other lists, not strings. If it makes sense, you can to something like `mm.eval("updateAE \"string\" " + ' '.join(each))` – Germano Jul 02 '14 at 09:08
  • @Germano While trying out your method, I am getting the latter error `Wrong number of arguments on call to updateAE` – dissidia Jul 02 '14 at 09:11
  • 1
    I know nothing about Mel, but from the doc you linked it seems like `updateAE` is expecting just *one* string argument and you are already passing a plain `"string"`. I'd look there for the solution. – Germano Jul 02 '14 at 09:18
  • @Germano I believe what you are saying is right. The mel seems to be looking for a single string rather than one that is read from the list, despite me adding `str(each)` or breaking up the list and inject it into the command... Unless I am doing it wrong – dissidia Jul 03 '14 at 01:57
  • 1
    Have you tried: `for each in ssList: for i in each: mm.eval("updateAE %s" % i)`? – Germano Jul 03 '14 at 06:38
  • @Germano Thanks, it works. But I am still getting insignificant tab errors displayed in my editor... – dissidia Jul 03 '14 at 07:00
  • why dont you register your own ae template? – joojaa Jul 07 '14 at 20:14
  • @joojaa Hmm... I think I have tried it and it fails? I was working on custom shaders though. Probably it is something to do with it as the test example I have cited works. Apologize that my previous comment is misleading, sorry!! – dissidia Jul 08 '14 at 02:20

0 Answers0