ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. Python 例.
polyGeoSampler([alphaBlend=string], [averageColor=boolean], [clampAlphaMax=float], [clampAlphaMin=float], [clampRGBMax=[float, float, float]], [clampRGBMin=[float, float, float]], [colorBlend=string], [colorDisplayOption=boolean], [computeShadows=boolean], [displaceGeometry=boolean], [flatShading=boolean], [ignoreDoubleSided=boolean], [lightingOnly=boolean], [reuseShadows=boolean], [sampleByFace=boolean], [scaleFactor=float], [shareUV=boolean], [useLightShadows=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
polyGeoSampler は、取り消し可能、照会不可能、および編集可能です。
選択したそれぞれの頂点またはフェースのサーフェス カラーと透明度のレンダー サンプリングを実行し、サンプリングしたデータをカラー値として格納するか、サンプリングしたデータを使用して、作用させる頂点またはフェースをサンプリングしたデータ値でディスプレイスメントします。透明度はディスプレイスメントに使用されず、ディスプレイスメントは頂点法線に沿って実行されます。サンプリングしたデータ値は、ユーザが定義した量であらかじめスケールできます。サンプリングする法線は、フラット シェーディング オプションを使用してオーバーライドできます。このオプションは、サンプリング値の計算時にフェースの法線を必ず使用します。これはエッジの平滑性の効果をオーバーライドしたい場合に望ましい場合があります。フラット シェーディング オプションをオンにすると、エッジは必ずハードであるとみなされます。頂点のディスプレイスメントは頂点に接続されたフェースに影響を与えるため、ディスプレイスメント サンプリングによって -sampleByFace オプションがオフになるので注意してください。共有された頂点カラーの保存の強制、そして共有されていない UV 値の使用の強制が可能です。結果のカラーの計算は、次のように実行されます。
RGB (計算値) = (RGB(サンプリング値) * スケール係数)
(カラー ブレンドが「none」の場合)
RGB (計算値) = RGB (ジオメトリ値)
(カラー ブレンドが「add」の場合)
RGB (計算値) = RGB (ジオメトリ値) + RGB (サンプリング値)
(カラー ブレンドが「subtract」の場合)
RGB (計算値) = RGB (ジオメトリ値) - RGB (サンプリング値)
(カラー ブレンドが「multiply」の場合) RGB (計算値)
RGB (計算値) = RGB (ジオメトリ値) * RGB (サンプリング値)
(カラー ブレンドが「divide」の場合)
RGB (計算値) = RGB (ジオメトリ値) / RGB (サンプリング値)
(カラー ブレンドが「average」の場合)
RGB (計算値) = (RGB(ジオメトリ値) * 1/2) + (RGB(サンプリング値) * 1/2)
(クランプ オプションが設定された場合)
RGB (最大値)と RGB (最小値)間の RGB (計算値)をサンプリングします。
結果としてのアルファ値を計算する場合も、同じような計算を実行します。このコマンドが -batch モードまたは -prompt モードで正しく動作するには、シーンでカメラを選択する必要があります。
poly, sampling, GeoSampler
polyColorPerVertex
alphaBlend, averageColor, clampAlphaMax, clampAlphaMin, clampRGBMax, clampRGBMin, colorBlend, colorDisplayOption, computeShadows, displaceGeometry, flatShading, ignoreDoubleSided, lightingOnly, reuseShadows, sampleByFace, scaleFactor, shareUV, useLightShadows
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
# Example 1. Sample for color values.
# a. No arguments. Will perform sampling of color + transparency at
# the vertex level, and store color values for affected vertices.
# No shadows will be computed.
cmds.polyGeoSampler()
# b. With shadows and illumination only
cmds.polyGeoSampler( lightingOnly=True, computeShadows=True )
# c. Sampling only complete selected faces
cmds.polyGeoSampler( sampleByFace=True )
# d. "Flat shading".
# Example 2. Sample for displacement values.
# a. Using displace option
cmds.polyGeoSampler( displaceGeometry=True )
# Example 3. Scaling the sampled data.
# a. Scaling option
cmds.polyGeoSampler( scaleFactor=0.1 )
# Example 4. Don't force unshared UV value usage, and force
# the storage of shared colors for vertices.
cmds.polyGeoSampler( shareUV=True, averageColor=True )
# Example 5. Clamping colors. In this example the alpha and
# RGB channels of the colors are clamped between a min of 0,0,0,1
# and a max of 1,2,1,0.5 .
cmds.polyGeoSampler( amn=0.0, amx=0.5, cmn=[0.0,0.0,0.0], cmx=[1.0,2.0,1.0] )
# Example 6. Multiply the new sample color values with the existing
# colors stored on the geometry, but leave the alpha values
# as they were on the geometry.
cmds.polyGeoSampler( colorBlend='multiply', alphaBlend='none' )