移動先: 概要 戻り値 フラグ Python の例

概要

colorIndex( int [float float float] , [hueSaturationValue=boolean], [resetToFactory=boolean], [resetToSaved=boolean])

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

colorIndex は「元に戻す」が可能、「照会」が可能、「編集」が不可能です。

このインデックスはカラー パレットのカラー インデックスを指定します。 R、G、B の値(0-1)は、カラーの RGB 値(または -hsv フラグ使用の場合は HSV 値)を指定します。

戻り値

int成功時に 1 を返します。

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

hueSaturationValue, resetToFactory, resetToSaved
ロング ネーム(ショート ネーム) 引数型 プロパティ
resetToFactory(rf) boolean create
カラー インデックス パレットのエントリをすべて、工場出荷時のデフォルトにリセットします。
resetToSaved(rs) boolean create
カラー パレットのエントリをすべて、保存した値にリセットします。
hueSaturationValue(hsv) boolean createquery
RGB 値が実際には HSV 値であることを示します。 照会時、3 つの浮動小数点の配列として HSV 値を返します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python の例

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 )