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

Synopsis

polyColorSet [-allColorSets] [-clamped boolean] [-colorSet string] [-copy] [-create] [-currentColorSet] [-currentPerInstanceSet] [-delete] [-newColorSet string] [-perInstance boolean] [-rename] [-representation string] [-shareInstances] [-unshared]

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
-allColorSets(-acs) 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.
-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.
-copy(-cp) 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) 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.
-currentColorSet(-ccs) 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.
-currentPerInstanceSet(-cpi) 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.
-delete(-d) createqueryedit
This flag when used will result in the deletion of the color set corresponding to the name specified with the colorSet flag.
-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.
-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.

-rename(-rn) 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.
-representation(-rpt) string createqueryedit
This flag corresponds to the color channels to used, for example A(alpha only), RGB, and RGBA.
-shareInstances(-si) 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.
-unshared(-us) 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.

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 be used more than once in a command.

MEL examples


// To set the current color set to be "color2".
polyColorSet -currentColorSet -colorSet "color2";

// To query the current color set.
polyColorSet -q -currentColorSet;

// To create a per-instance color set family with one set member
// per selected instance.
polyColorSet -create -colorSet "perInst" -perInstance true -unshared;

// To create a per-instance color set family with one set member
// for all selected instances.
polyColorSet -create -colorSet "perInst" -perInstance true;

// To rename a currently existing color set from "color3" to "color4".
polyColorSet -rename -colorSet "color3" -newColorSet "color4";

// Rename the current color set (if any) to "color3".
polyColorSet -rename -newColorSet "color3";

// To delete a currently existing color set "color3".
polyColorSet -delete -colorSet "color3";

// To delete the current color set (if any)
polyColorSet -delete;

// 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.
polyColorSet -copy -colorSet "color1" -newColorSet "color2";

// Copy values of the current color set to "color2"
polyColorSet -copy -newColorSet "color2";

// Make a copy of "color1" to a new color set. The
// name of which is automatically generated and returned.
polyColorSet -copy -colorSet "color1";

// Create a new empty color set
polyColorSet -create -colorSet "newColor";

// Create a new empty color set with a generate new name
// The newly generated name is returned.
polyColorSet -create;

// Create a new empty color set that has the values in the
// range from 0 to 1 and has 3 channels of R, G, and B.
polyColorSet -create -clamped true -representation "RGB" -colorSet "color5";

// To query all of the color sets
polyColorSet -q -allColorSets;

// To query all of the color set names and their representation values
polyColorSet -q -allColorSets -representation;

// To query the clamped value of the current color set
polyColorSet -q -currentColorSet -clamped;