Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

polyColorSet([allColorSets=boolean], [clamped=boolean], [colorSet=string], [copy=boolean], [create=boolean], [currentColorSet=boolean], [currentPerInstanceSet=boolean], [delete=boolean], [newColorSet=string], [perInstance=boolean], [rename=boolean], [representation=string], [shareInstances=boolean], [unshared=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

polyColorSet is undoable, queryable, and editable.

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

Return value

booleanSuccess or Failure.

In query mode, return type is based on queried flag.

Keywords

poly, colorSet, currentColorSet, renameColorSet, deleteColorSet, copyColorSet, createColorSet

Flags

allColorSets, clamped, colorSet, copy, create, currentColorSet, currentPerInstanceSet, delete, newColorSet, perInstance, rename, representation, shareInstances, unshared
Long name (short name) Argument types Properties
colorSet(cs) string createqueryedit
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.
currentColorSet(ccs) boolean createqueryedit
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.
newColorSet(nc) string createqueryedit
Specifies the name that the color set corresponding to the name specified with the colorSet flag, needs to be renamed to.
rename(rn) boolean createqueryedit
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.
delete(d) boolean createqueryedit
This flag when used will result in the deletion of the color set corresponding to the name specified with the colorSet flag.
copy(cp) boolean createqueryedit
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) boolean createqueryedit
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.
allColorSets(acs) boolean createqueryedit
This flag when used in a query will return a list of all of the color set names
clamped(cla) boolean createqueryedit
This flag specifies if the color set will truncate any value that is outside 0 to 1 range.
representation(rpt) string createqueryedit
This flag corresponds to the color channels to used, for example A(alpha only), RGB, and RGBA.
perInstance(pi) boolean createqueryedit
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.

unshared(us) boolean createqueryedit
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.
shareInstances(si) boolean createqueryedit
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.
currentPerInstanceSet(cpi) boolean queryedit
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 command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# To set the current color set to be "color2".
cmds.polyColorSet(currentColorSet=True, colorSet= 'color2' )
# To query the current color set.
cmds.polyColorSet( query=True, currentColorSet=True )
# To create a per-instance color set family with one set member
# per selected instance.
cmds.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.
cmds.polyColorSet(create=True,colorSet='perInst',perInstance=True)
# To rename a currently existing color set from "color3" to "color4".
cmds.polyColorSet( rename=True, colorSet= 'color3', newColorSet= 'color4' )
# Rename the current color set (if any) to "color3".
cmds.polyColorSet( rename=True, newColorSet= 'color3')
# To delete a currently existing color set "color3".
cmds.polyColorSet( delete= True, colorSet= 'color3')
# To delete the current color set (if any)
cmds.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.
cmds.polyColorSet( copy= True, colorSet='color1', newColorSet ='color2')
# Copy values of the current color set to "color2"
cmds.polyColorSet( copy= True, newColorSet='color2')
# Make a copy of "color1" to a new color set. The
# name of which is automatically generated and returned.
cmds.polyColorSet( copy= True, colorSet='color1' )
# Create a new empty color set
cmds.polyColorSet( create=True, colorSet='newColor')
# To query all of the color sets
cmds.polyColorSet( query=True, allColorSets=True )
# To query all of the color set names and their representation values
cmds.polyColorSet( query=True, allColorSets=True, representation=True )
# To query the clamped value of the current color set
cmds.polyColorSet( query=True, currentColorSet=True, clamped=True )