pymel.core.modeling.polyColorSet

polyColorSet(*args, **kwargs)

Command to do the following to color sets: - delete an existing color set. - rename an existing color set. - create a new empty color set. - set the current color set to a pre-existing color set. - modify sharing between instances of per- instance color sets - query the current color set. - query the names of all color sets. - query the name(s) along with representation value(s) or clamped value(s) of all color sets - query the representation value or clamped value of the current color set

Flags:
Long name (short name) Argument Types Properties
allColorSets (acs) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
This flag when used in a query will return a list of all of the color set names
clamped (cla) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
This flag specifies if the color set will truncate any value that is outside 0 to 1 range.
colorSet (cs) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies the name of the color set that this command needs to work on. This flag has to be specified for this command to do anything meaningful other than query the current color set.

copy (cp) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag when used will result in the copying of the color set corresponding to name specified with the colorSet flag to the colorSet corresponding to the name specified with the newcolorSet flag

create (cr) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag when used will result in the creation of an empty color set corresponding to the name specified with the colorSet flag. If a color set with that name already exists, then no new color set will be created.

currentColorSet (ccs) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag when used will set the current color set that the object needs to work on, to be the color set corresponding to the name specified with the colorSet flag. This does require that a colorSet with the specified name exist. When queried, this returns the current color set.

currentPerInstanceSet (cpi) bool ../../../_images/query.gif ../../../_images/edit.gif
 

This is a query-only flag for use when the current color set is a per-instance color set family. This returns the member of the set family that corresponds to the currently select instance.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

delete (d) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
This flag when used will result in the deletion of the color set corresponding to the name specified with the colorSet flag.
newColorSet (nc) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specifies the name that the color set corresponding to the name specified with the colorSet flag, needs to be renamed to.
perInstance (pi) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag can be used in conjunction with the create flag to indicate whether or not the color set is per-instance. When you create a per-instance color set, the set will be applied as shared between all selected instances of the shape unless the unshared flag is used. The perInstance flag can be used in query mode with the currentColorSet or allColorSets flag to indicate that the set family names (i.e. not containing instance identifiers) will be returned by the query. In query mode, this flag can accept a value.

rename (rn) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag when used will result in the renaming of the color set corresponding to the name specified with the colorSet flag to the name specified using the newColorSet flag.

representation (rpt) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
This flag corresponds to the color channels to used, for example A(alpha only), RGB, and RGBA.
shareInstances (si) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag is used to modify the sharing of per-instance color sets within a given color set family so that all selected instances share the specified set. In query mode, it returns a list of the instances that share the set specified by the colorSet flag.

unshared (us) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag can be used in conjunction with the create and perInstance flags to indicate that the newly created per-instance set should be created with a separate set per instance.

Derived from mel command maya.cmds.polyColorSet

Example:

import pymel.core as pm

import maya.cmds as cmds

# To set the current color set to be "color2".
pm.polyColorSet(currentColorSet=True, colorSet= 'color2' )
# To query the current color set.
pm.polyColorSet( query=True, currentColorSet=True )
# To create a per-instance color set family with one set member
# per selected instance.
pm.polyColorSet(create=True,colorSet='perInst',perInstance=True,unshared=True)
# To create a per-instance color set family with one set member
# for all selected instances.
pm.polyColorSet(create=True,colorSet='perInst',perInstance=True)
# To rename a currently existing color set from "color3" to "color4".
pm.polyColorSet( rename=True, colorSet= 'color3', newColorSet= 'color4' )
# Rename the current color set (if any) to "color3".
pm.polyColorSet( rename=True, newColorSet= 'color3')
# To delete a currently existing color set "color3".
pm.polyColorSet( delete= True, colorSet= 'color3')
# To delete the current color set (if any)
pm.polyColorSet( delete=True )
# Copy values of color set "color1" to "color2"
# Note if the second color set exist it will be overwriten by
# the copy. Leaving the destination color blank and the command
# will generate a new unique name based on the source name.
pm.polyColorSet( copy= True, colorSet='color1', newColorSet ='color2')
# Copy values of the current color set to "color2"
pm.polyColorSet( copy= True, newColorSet='color2')
# Make a copy of "color1" to a new color set. The
# name of which is automatically generated and returned.
pm.polyColorSet( copy= True, colorSet='color1' )
# Create a new empty color set
pm.polyColorSet( create=True, colorSet='newColor')
# To query all of the color sets
pm.polyColorSet( query=True, allColorSets=True )
# To query all of the color set names and their representation values
pm.polyColorSet( query=True, allColorSets=True, representation=True )
# To query the clamped value of the current color set
pm.polyColorSet( query=True, currentColorSet=True, clamped=True )

Previous topic

pymel.core.modeling.polyColorPerVertex

Next topic

pymel.core.modeling.polyCompare

Core

Core Modules

Other Modules

This Page