0

I want to create an UI that list all options relative to an attribute that have an option menu and get it in my own option menu.

The UI building is fine but i cant get the option for the attribute. I found this command : "attrEnumOptionMenu" and it seems to work only with some kind of attribute (dunno if am right or wrong about this) here's the result so far :

Error: RuntimeError: file <maya console> line 10: Invalid attribute.

line 10 being the attrEnumOptionMenu line in my SciptEditor

import maya.cmds as cmds

window = cmds.window()
cmds.columnLayout()
node = cmds.ls(sl=True, type='file')
attrib = node[0] + '.colorSpace'
print attrib


cmds.attrEnumOptionMenu( label='Color space :  ', attribute=attrib );
cmds.showWindow( window )
furas
  • 134,197
  • 12
  • 106
  • 148
KL75
  • 3
  • 1
  • I suppose the problem here is the fact that the colorSpace attribute is not an enum attribute (have a look at attributeQuery -enum). You could have a look at the file template script to see where the color spaces names are located. – haggi krey Jul 22 '19 at 07:44
  • Thx for the infos. Turn out its not an enum attributes... found another way to do my tool but i'm limited with an arbitrary list of color space... the point in enum the list of options was to have a tool that adapt to the options set with different color space such as ACES. Do you know where i can find the file template exactly ? are they .py ? – KL75 Jul 22 '19 at 23:44
  • Have a look at scripts/AETemplates/AEfileTemplate.mel. – haggi krey Jul 23 '19 at 14:10
  • Or to be a little bit more exact check this: colorManagementPrefs -q -inputSpaceNames – haggi krey Jul 23 '19 at 14:12
  • Thx a lot it worked just fine! i assume it should work also when working with ACES or any other color space. – KL75 Jul 27 '19 at 09:48

0 Answers0