ジャンプ先: 概要. 戻り値. キーワード. フラグ. 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 // 100 ポイントのサンプリング サンプリングするポイントが複数あり、それらがすべて正規のグリッド構造である場合は、後者の方法を使用してこのルーチンをコールする方がより効率的です。これは、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
| ロング ネーム(ショート ネーム) |
引数タイプ |
プロパティ |
coordU(u)
|
float
|

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

|
|
テクスチャをサンプリングする V 座標を入力します。
|
|
maxU(xu)
|
float
|
|
|
既定は 1.0 です。サンプリングする U 方向の最大の境界です。
|
|
maxV(xv)
|
float
|
|
|
既定は 1.0 です。サンプリングする V 方向の最大の境界です。
|
|
minU(mu)
|
float
|
|
|
既定は 0.0 です。サンプリングする U 方向の最小の境界です。
|
|
minV(mv)
|
float
|
|
|
既定は 0.0 です。サンプリングする V 方向の最小の境界です。
|
|
output(o)
|
string
|
|
|
出力するデータのタイプ: A = アルファ値のみ RGB = カラー値のみ RGBA = カラー値とアルファ値
|
|
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).