Maya 2016 file node Color Space inactive

In Maya 2016 if I create a file node with python the Color Space attribute is locked and I am not able to modify it.

import pymel.core as pm
FILE = pm.shadingNode('file', asTexture=True, name='FILE')
print FILE.colorSpace.get()

Here is the Maya file

How can I fix this? Maya settings are default…

You should be able to do FILE.colorSpace.unlock() to unlock the attribute.

1 Like

It does not return any errors, but the attribute remains gray. Probably it’s not locked and I can set/get this attribute with Python.

How can I set this attribute? FILE.colorSpace.set(2) returns

>> Error: ... Its values must be set with a -type flag

When assigning a value for colorSpace, or maybe specifically enum values, you have to specify the type you’re using to assign the value.

So if you knew the name of the enum item you want to assign to you would add the flag type=‘string’ to the setter command or in your case I would think type=‘int’ would represent the index of the enum.

Using the type flag worked for me in Maya 2017 and newer, so I hope it would work for you as well.

Ok, the isColorManaged flag missed in PyMel docs.

True FILE = pm.shadingNode('file', asTexture=True, isColorManaged = True, name='FILE')