Python command for Maya : attributeQuery doesn't work for imagePlane attribute 'colorSpace'

415 Views Asked by At

I am trying to get the list of colorSpace options available for a given imagePlane in Maya in Python.

I tried :

print cmds.attributeQuery('colorSpace', n='<nameofImagePlane>', le=True)

But this returns 'none' which surprises me as it works perfectly fine for other enum attributes like 'type', 'displayMode', 'textureFilter' etc. returning their values.

Can anyone please suggest why this could happen or if there is a workaround or a different way to return the available colorSpaces for a given imagePlane.

1

There are 1 best solutions below

1
On BEST ANSWER

It's not listing anything because it's not an emum, and that can easily be confirmed by running this cmds.attributeQuery("colorSpace", node="imagePlaneShape1", enum=True).

I think what you're after is this command: cmds.colorManagementCatalog(listTransformConnections=True, type='input')

You may have to mess around with the type parameter, but "input" seems to be giving the right results of all available color spaces.