移動先: 概要 戻り値 キーワード. フラグ. Python 例.
colorAtPoint([coordU=float], [coordV=float], [maxU=float], [maxV=float], [minU=float], [minV=float], [output=string], [samplesU=uint], [samplesV=uint])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
colorAtPoint は 「元に戻す」が不可能、「照会」が不可能、「編集」が不可能 です。
colorAtPoint コマンドは、UV 座標で渡したテクスチャ シェーダまたは海洋シェーダを照会するために使用します(海洋シェーダの場合、UV はワールド座標空間の X と Z です)。
戻り値は、渡した入力 UV 引数の数または照会された値によってサイズが決定される浮動小数点配列です。アルファ値のみ、RGB 値のみ、または RGBA 値を照会することができます。
返される配列には単一のインデックスが付けられるので、RGB 値を指定した場合、赤の値のインデックスは index * 3 になります。青は index * 3 + 1、緑は index * 3 + 2 になります。RGBA 値では、3 の代わりに 4 の倍数を使用します。
アルファ値のみの場合は、インデックスをそのまま使用できます。
基本的な引数書式は 2 つあります。
colorAtPoint -u 0 -v 0 -u .2 -v .1 など。すべてのポイントについて
または
colorAtPoint -mu 0 -mv 0 -xu 1 -xv 1 -su 10 -sv 10 // samples 100 points
複数のポイントをサンプリングする場合で、それらがすべて標準のグリッド構造内にあるときは、UV 座標を記述する長い引数書式よりも、最小/最大の UV 座標とサンプル数を使用する後者の手法でこのルーチンを呼び出すほうが効率的です。
- 値を返す(-o A、RGB、 RGBA )
- サンプリングする個々の UV 座標(-u float -v float )
- (-u と -v への呼び出しは一致する必要があります)
- サンプリングする、ポイントが均一なグリッド(-su int -sv int)
- (-u または -v との併用はできません)
- サンプル グリッドの境界(-mu float -mv float -xu float -xv float)
なし
texture, color, alpha, uv, ocean, outColor, paramUV
coordU, coordV, maxU, maxV, minU, minV, output, samplesU, samplesV
ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
output(o)
|
string
|
|
|
出力するデータのタイプ:
A = アルファ値のみ
RGB = カラー値のみ
RGBA = カラー値とアルファ値
|
|
coordU(u)
|
float
|

|
|
テクスチャをサンプリングする U 座標を入力します。
|
|
coordV(v)
|
float
|

|
|
テクスチャをサンプリングする V 座標を入力します。
|
|
minU(mu)
|
float
|
|
|
デフォルトは 0.0 です。
サンプリングする U 方向の最小の境界です。
|
|
minV(mv)
|
float
|
|
|
デフォルトは 0.0 です。
サンプリングする V 方向の最小の境界です。
|
|
maxU(xu)
|
float
|
|
|
デフォルトは 1.0 です。
サンプリングする U 方向の最大の境界です。
|
|
maxV(xv)
|
float
|
|
|
デフォルトは 1.0 です。
サンプリングする V 方向の最大の境界です。
|
|
samplesU(su)
|
uint
|
|
|
デフォルトは 1 です。
U 次元でサンプリングするポイントの数です。
|
|
samplesV(sv)
|
uint
|
|
|
デフォルトは 1 です。
V 次元でサンプリングするポイントの数です。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# The return value is the array of values determined by the number of
# coord flag uses or samplesU * samplesV. The default return value is alpha.
# If instead the return value is RGB there will be 3 times as many values returned,
# and if it is RGBA there will be 4 times as many values.
cmds.createNode( 'checker' )
cmds.colorAtPoint( 'checker1' )
# returns the alpha value at uv (0.0,0.0) for texture checker1
# The return array will have one entry corresponding to this alpha.
cmds.colorAtPoint( 'checker1', u=.5, v=.5 )
# returns the alpha value at uv (0.5,0.5) for texture checker1
# The return array will have one entry corresponding to this alpha.
cmds.colorAtPoint( 'checker1', o='RGB', u=(.5, 0.0), v=(.5, 0.1) )
# returns the colors at uv (0.5,0.5) and (0.0, 0.01) for texture checker1
# The return array will have 6 values in the following order: RGBRGB
cmds.colorAtPoint( 'checker1', o='A', su=11, sv=6 )
# returns the alpha for 50 points in a uniform 11 by 6 grid mapped across
# uv (0.0, 0.0) to uv (1.0, 1.0) The 12th point would be the first point
# in the second row of samples where uv = (0.0, 0.2)
cmds.colorAtPoint( 'checker1', o='A', su=3, sv=3, mu=0.3, mv=0.3, xu=0.4, xv=0.4 )
# returns the alpha for 9 points in a uniform 3 by 3 grid mapped across
# uv (0.3, 0.3) to uv (0.4, 0.4) The 4th point would be the first point
# in the second row of samples where uv = (0.35, 0.3).