v4.0
指定の入力オブジェクトに新しいテクスチャ レイヤを追加し、既存のクリップまたはソースに接続します。 レイヤの詳細については、「AddTextureLayer」を参照してください。
ソースが与えられると、クリップが自動的に作成され、接続されます。
oReturn = AddClipTextureLayer( Clip, [InputObjs], [Name], [After], [Reference] ); |
作成された場合は、新しい TextureLayer オブジェクトを戻します。
| パラメータ | タイプ | 説明 |
|---|---|---|
| Clip | 文字列 | 新しく作成されたレイヤにアタッチするクリップ(またはソース) |
| InputObjs | 文字列 |
テクスチャ レイヤの追加先のコンテナ(シェーダまたはマテリアル)のリスト。 すべてのコンテナが単一のレンダ ツリーに含まれている必要があります。 デフォルト値: 現在選択されている値 |
| Name | 文字列 | 新しいレイヤに使用する名前。 既存のレイヤが渡された場合には、この引数は無視されます。 |
| After | Boolean |
True の場合は、新しいテクスチャ レイヤはリファレンス レイヤの後に挿入されます。 False の場合は、リファレンス レイヤの前に挿入されます。 リファレンス レイヤがないときは、True の場合はコンテナのリストの最後に、False の場合はリストの最初に追加されます。 デフォルト値: True |
| Reference | 文字列またはオブジェクト | 新しく追加されたレイヤが配置されるスタック内の位置を示す、リファレンス テクスチャ レイヤ。 レイヤはリファレンス レイヤの前後に挿入されます。 指定しない場合には、新しいレイヤは "After" 引数の値に応じて先頭または末尾に追加されます。 |
' Create a sphere, add a default material and texture projection
NewScene , false
set oSphere = CreatePrim("Sphere", "MeshSurface")
ApplyShader , , , , siLetLocalMaterialsOverlap
CreateProjection oSphere, siTxtPlanarXY, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"
' Create a new clip
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" )
' Add a new layer with the provided image.
Dim oLayer
set oLayer = AddClipTextureLayer(oClipObj, oSphere.material & ".Phong")
logmessage "Created Layer " & oLayer
' Add the diffuse port to the layer
AddTextureLayerPorts oLayer, oSphere.material & ".Phong.diffuse"
' If we provide a source, a clip is automatically created.
set oLayer = AddClipTextureLayer(oSourceObj, oSphere.material & ".Phong")
logmessage "Created Layer " & oLayer
' Add the transparency port to the layer
AddTextureLayerPorts oLayer, oSphere.material & ".Phong.specular"
'-------------------------
' Output of script:
'
'INFO : "Created Layer Sources.DefaultLib.Material.Phong.XSIlogo_Clip_Layer"
'INFO : "Created Layer Sources.DefaultLib.Material.Phong.XSIlogo_Layer"
'
' If you open the texture layer editor, you will find there are two layers, one affecting
' the diffuse component and the other the transparency component of the Phong shader.
'------------------------- |