Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Changing color space for texture node in python

Changing color space for texture node in python

Anonymous
Not applicable
2,943 Views
5 Replies
Message 1 of 6

Changing color space for texture node in python

Anonymous
Not applicable

Hi.

I want to change the color space of "selected texture node" in python. (for ex: changing normal map color space to raw)

 

i tried to search colorManagementPrefs but couldn't find it.

 

So any help? 

Thank you. have a nice day

0 Likes
2,944 Views
5 Replies
Replies (5)
Message 2 of 6

mspeer
Consultant
Consultant
Message 3 of 6

Anonymous
Not applicable

Well thank you... but I don't see any command.

 

I'm looking for a page like this. I don't know how to use this

 

0 Likes
Message 4 of 6

mspeer
Consultant
Consultant

Hi!

 

There is no command, it's an Attribute of a node. Use a command to get and set Attributes.

Please read the Maya Online Help / Documentation for more details.

Message 5 of 6

Autodesk-NA
Explorer
Explorer

very helpful - lmao

0 Likes
Message 6 of 6

Kahylan
Advisor
Advisor

I mean, @mspeer  isn't wrong, though... It is an attribute, so all you need to use is the set attr command. There is no specific command for this afaik. Changing attributes is a very basic operation.

If you are looking for how to do it, this would change all the selected file [Texture] nodes .colorSpace Attribute to Gamma 2.2 / Rec.709:

 

import maya.cmds as mc


sel = mc.ls(sl = True)

for s in sel:
   

    mc.setAttr(sel + ".colorSpace", "Gamma 2.2 / Rec.709", type = "string")

 

0 Likes