I'm wondering if anyone knows of a script to change the selected object's Display Color Channel from Ambient+Diffuse to None. I can't find anything on google. Any help would be greatly appreciated!
# Toggle between Ambient+Diffuse and None display modes. import maya.cmds as cmds selectedShapes = cmds.ls(transforms=True, selection =True)
defSetDisplay(curShape ,curMode): if curMode =="Ambient+Diffuse": cmds.setAttr(curShape +'.displayColorChannel','None', type ='string') else: cmds.setAttr(curShape +'.displayColorChannel','Ambient+Diffuse', type ='string')
for shape in selectedShapes: curMode = cmds.getAttr(shape +'.displayColorChannel', asString =True) SetDisplay(shape,curMode)
Here's a quick script to toggle between the two different modes. The ".displayColorChannel" is the attribute you'll want to be getting and setting.
Replies