ジャンプ先: 概要. 戻り値. フラグ. Python 例.

概要

color( [objects] , [rgbColor=[float, float, float]], [userDefined=int])

注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。

color は、取り消し可能、照会不可能、および編集不可能です。

このコマンドは、指定したオブジェクトの固定ワイヤフレーム カラーがそのオブジェクトのクラス カラーになるように設定するか、または -ud/userDefined フラグを指定している場合は、ユーザ定義カラーの 1 つを設定します。ユーザが浮動小数点 RGB カラーが必要な場合は、-rgb/rgbColor フラグを指定できます。

戻り値

なし

フラグ

rgbColor, userDefined
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
rgbColor(rgb) [float, float, float] create
選択したオブジェクトに設定する、RGB カラーを指定します。
userDefined(ud) int create
選択したオブジェクトに設定する、ユーザ定義のカラー インデックスを指定します。有効な数値は 1~8 です。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。

Python 例

import maya.cmds as cmds

# create a sphere and deselect it
cmds.sphere( n='sphere1' )
cmds.select( d=True )

# Set the inactive wireframe color of the sphere to the
# first user defined color
cmds.color( 'sphere1', ud=1 )

# rgb defined color (red)
cmds.color( 'sphere1', rgb=(1, 0, 0) )

# set the wireframe color of the sphere back to its default color
cmds.color( 'sphere1' )