pymel.core.general.color¶
- color(*args, **kwargs)¶
This command sets the dormant wireframe color of the specified objects to be their class color or if the -ud/userDefined flag is specified, one of the user defined colors. The -rgb/rgbColor flags can be specified if the user requires floating point RGB colors.
Flags:
Long Name / Short Name Argument Types Properties rgbColor / rgb float, float, float Specifies and rgb color to set the selected object to. userDefined / ud int Specifies the user defined color index to set selected object to. The valid range of numbers is [1-8]. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.color
Example:
import pymel.core as pm # create a sphere and deselect it pm.sphere( n='sphere1' ) # Result: [nt.Transform(u'sphere1'), nt.MakeNurbSphere(u'makeNurbSphere1')] # pm.select( d=True ) # Set the inactive wireframe color of the sphere to the # first user defined color pm.color( 'sphere1', ud=1 ) # set the wireframe color of the sphere back to its default color pm.color( 'sphere1' )