Go to: Synopsis. Return value. Flags. Python examples.
colorIndex( int [float float float] ,
[hueSaturationValue=boolean],
[resetToFactory=boolean],
[resetToSaved=boolean])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
colorIndex is undoable, queryable, and NOT editable.
The index specifies a color index in the color palette. The r, g,
and b values (between 0-1) specify the RGB values (or the HSV
values if the -hsv flag is used) for the color.
int |
Returns 1 on success. |
In query mode, return type is based on queried flag.
hueSaturationValue, resetToFactory, resetToSaved
Long name (short name) |
Argument types |
Properties |
resetToFactory(rf) |
boolean |
 |
|
Resets all color index palette entries to their factory
defaults. |
|
resetToSaved(rs) |
boolean |
 |
|
Resets all color palette entries to their saved values. |
|
hueSaturationValue(hsv) |
boolean |
  |
|
Indicates that rgb values are really hsv values. Upon query,
returns the HSV valuses as an array of 3 floats. |
|
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. |
import maya.cmds as cmds
# Set the first entry in the color palette to have RGB values 1 0 0 - red.
cmds.colorIndex( 1, 1, 0, 0 )
# Set the first entry in the color palette to have HSV values 360 1 1 - red.
cmds.colorIndex( 1, 360, 0, 0, hsv=True )
# Return the RGB color values of the first entry of the color palette.
cmds.colorIndex( 1, q=True )
# Return the HSV color values of the first entry of the color palette.
cmds.colorIndex( 1, q=True, hsv=True )