I'm developing a tool regarding shaders in Maya and I'm learning pymel to do it (until now i rely in maya.cmds and mel).
I like pymel a lot but i'm having trouble to understand the hierarchy of nodes like color. i know that you can set a color in a shader like this:
selObj = pm.ls(sl=1)
blinnDark = pm.shadingNode('blinn', asShader=True)
blinnDark.color.set([0.3, 0.3, 0.3])
pm.select(selObj)
pm.hyperShade( assign=blinnDark )
How can I access to attributes like hue, saturation, value and edit and set them?
Replies
A quick Google suggests maya doesn't have any built in functions to do the rgb-hsv-rgb conversion so I'd suggest using PIL or one of the other image libraries to deal with the maths because vanilla python is ill suited to the sort of sums you have to do.
Normally I'd say to use openCV for this sort of things but getting that running inside maya is a hell of an ordeal
However, it does look like the color class covers all that. You probably just need to tell it which type when you set it as per this..
set(colorModel, c1, c2, c3, alpha=1.0)
hope it could be useful for someone struggling with the same problems there