BlendClipsInTextureLayers

導入

v4.0

カテゴリ

shader

詳細

指定したオブジェクトにアタッチされたイミディエイト シェーダで、すべてのデフォルト テクスチャ ポート(接続ポイント)の位置を指定します。 要求されたクリップでレイヤを作成し、作成したレイヤを指定のポートに追加します。

ソースが与えられると、クリップが自動的に作成され、接続されます。

スクリプト構文

oReturn = BlendClipsInTextureLayers( ClipList, [InputObjs], [SharedMatAction], [NotifyNoResult], [Mode], [Ambient], [Diffuse], [Transparency], [Reflection] );

戻り値

作成されたレイヤを XSICollection として戻します。 Mode の値が siReplaceNoBlend である場合は、最初のイメージ シェーダが、レイヤではなくシェーダとして戻されます。

パラメータ

パラメータ タイプ 詳細
ClipList 文字列 レイヤにアタッチするクリップのリスト
InputObjs 文字列 デフォルトのテクスチャ接続ポイントを検索するオブジェクトのリスト

デフォルト値: 現在選択されている値

SharedMatAction Integer 共有マテリアルをローカルに設定するかどうかを設定します。 注: 「初級ユーザ」が使用した場合には、「2」ではなくユーザの選択(0=No、1=Yes)がスクリプト ウィンドウに表示されます。 記録されているコマンドが再度実行されると、コマンドは「可」または「不可」の応答を自動的に返します。 「上級ユーザ」を使用した場合は、上級ユーザとしてログに記録され、再度実行されるときにポップアップ ダイアログが表示されます。

デフォルト値:2 (初級ユーザに確認)

指定可能な値:

説明:

0 不可
1
2 初級ユーザに確認
3 上級ユーザに確認
NotifyNoResult ブール プリセットが作成されない場合に、ユーザに通知するには True。

デフォルト値:False (通知しない)

Mode siBlendInTextureLayersModes 新しいプリセットでのブレンディング方法

デフォルト値:siBlendInTextureLayers (置き換えない)

Ambient ブール True の場合、アンビエント ポート(存在する場合)にブレンドします。

デフォルト値:True (アンビエントを適用)

Diffuse ブール True の場合、ディフューズ ポート(存在する場合)にブレンドします。

デフォルト値:True (ディフューズを適用)

Transparency ブール True の場合、トランスペアレンシ ポート(存在する場合)にブレンドします。

デフォルト値:False (トランスペアレンシを適用しない)

Reflection ブール True の場合、リフレクション ポート(存在する場合)にブレンドします。

デフォルト値:False (リフレクションを適用しない)

VBScript の例

NewScene , false
' Create a default cube, add a texture projection and apply a default Phong shader:
Dim oBox
Set oBox = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )
CreateProjection oBox, , siTxtDefaultPlanarXY, , "Texture_Projection"
ApplyShader , oBox
' Apply a second projection, offset it
CreateProjection oBox, , siTxtDefaultPlanarXY, , "Texture_Projection"
Translate "Texture_Support1", 3.32038834951456, -4.87670131554974E-17, 0.796452068099767, siRelative, siView, siObj, siXYZ
Translate "Texture_Support1", -0.529657563043749, -2.59749993985792, 0.259749993985792, siRelative, siView, siObj, siXYZ
' First, add an image source.
Dim oSourceObj, ImageFile
ImageFile = Application.InstallationPath( siFactoryPath ) & "/Data/XSI_SAMPLES/Pictures/xsilogo.jpg"
SIAddImageSource ImageFile, "XSIlogo", oSourceObj
' Now create an image clip from the image source.
Dim oClipObj 
set oClipObj = AddImageClip( oSourceObj, "XSIlogo_Clip" )
' Blend in the clip
Dim result, item
set result = BlendClipsInTextureLayers(oClipObj, oBox)
for each item in result
        logmessage "Added layer " & item
next 
' Blending in a source automatically creates a clip
set result = BlendClipsInTextureLayers(oSourceObj, oBox)
for each item in result
        logmessage "Added layer " & item
next
' Change the blending mode of the newly added layer
SetValue result(0) & ".mode", 4
' Change the texture projection
Dim shader
set shader = SIGetShaderOnCnxPoint( result(0) & ".color" )
SetInstanceDataValue , shader & ".tspace_id", "Texture_Projection1"
'---------------------------------------------------------
' If you draw a region, you should see two Softimage logos shifted relative to each other
' If you open up the texture layer editor or rendertree on the cube, you will see two layers.
' Output from this script:
'INFO : "Added layer Sources.DefaultLib.Material.Phong.Image_Layer"
'INFO : "Added layer Sources.DefaultLib.Material.Phong.Image1_Layer"
'---------------------------------------------------------

関連項目

BlendClipsInTextureLayersInsp BlendClipsInTextureLayersWithPorts BlendClipsInTextureLayersWithPortsInsp BlendInTextureLayersInsp BlendInTextureLayersWithPorts BlendInTextureLayersWithPortsInsp SIConnectShaderToCnxPoint SIApplyShaderToCnxPoint