how change "display color channel" parametr?

308 views
Skip to first unread message

morem...@gmail.com

unread,
Jul 20, 2016, 4:19:37 PM7/20/16
to Python Programming for Autodesk Maya
hi!
how change "display color channel" parametr?
http://s6.uplod.ir/i/00802/v6pded3ug2um.jpg

Morten Bøhne

unread,
Jul 23, 2016, 11:51:30 AM7/23/16
to Python Programming for Autodesk Maya, morem...@gmail.com
this seems to work for me (only tested it in 2015:

from pymel.core import *
mesh
= ls(sl=True)[0]
# change displayColorChannel to none
mesh
.displayColorChannel.set('None')


your options are:
'None'
'Ambient'
'Ambient+Diffuse'
'Specular'
'Emission'

The attribute Editor doesn't seem to update the value right away, not sure why :\

Geordie Martinez

unread,
Jul 24, 2016, 1:51:41 AM7/24/16
to python_in...@googlegroups.com, morem...@gmail.com
Be sure and import into a namespace instead of *.
import pymel.core as pm
And you can get a list of selected in pymel with 
pm.selected()
As for the slow update of the AE, not sure.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4d2e87bb-47d3-4dc0-8c73-1b4e05557208%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

33th...@gmail.com

unread,
Jul 25, 2016, 5:41:50 AM7/25/16
to Python Programming for Autodesk Maya, morem...@gmail.com
an api alternative :D


import maya.api.OpenMaya as om

sel = om.MGlobal.getActiveSelectionList()
fn = om.MFnDependencyNode()

for i in xrange(sel.length()):
dagNode = sel.getDagPath(i)
dagNode.extendToShape()

fn.setObject(dagNode.node())
c = fn.findPlug("displayColorChannel", True)

c.setString("Diffuse")
Reply all
Reply to author
Forward
0 new messages