BlendInTextureLayersWithPortsInsp

導入

v4.0

詳細

要求されたプリセットとともにレイヤを作成して戻します。また、指定のポートをレイヤに追加します。

注: このコマンドは BlendInTextureLayersWithPorts と同等ですが、新しく作成されたシェーダも調べる点が異なります。

スクリプト構文

oReturn = BlendInTextureLayersWithPortsInsp( [PresetNames], [InputObjs] );

戻り値

作成されたレイヤを XSICollection として戻します。

パラメータ

パラメータ タイプ 説明
PresetNames 文字列 接続するシェーダ/イメージに対応するシェーダ プリセット

デフォルト値: 「Image」

InputObjs 文字列 新しいレイヤをブレンドするシェーダ接続のリスト

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

VBScript の例

'

' This example demonstrates how to apply blended shaders to a specific connection

' point on a cube. It also shows how to access the shader information both from the

' collection returned by BlendInTextureLayersWithPortsInsp and through the object's material.

'

NewScene , false

' Create a default cube and apply a default Phong shader:

Set oBox = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )

ApplyShader , oBox

' Apply Cloud and Gradient presets on the cube's Material Surface port:

Set oLayers = BlendInTextureLayersWithPortsInsp( "Cloud,Gradient", _

	oBox.Material.Parameters( "Surface" ) )

' At this point you will also see a Multiple Property Sets page pop up for the shaders.

' Now display the name of the created layers:

For Each oLayer In oLayers

	Set oShader = SIGetShaderOnCnxPoint( oLayer & ".color" )

	Application.LogMessage oLayer.Name & " created with shader " & oShader.Name

Next

' View the results in a rendered frame. (The colors appear quite smooth.)

RenderPasses oDefPass, 1, 1

' Set the mode of the Gradient to "Darken":

SetValue oBox.Material & ".Gradient_Layer.mode", 8

' View the results in a rendered frame. (Now the colors seem to have a mottled effect.) 

RenderPasses oDefPass, 1, 1

' Output of above script:

'INFO : "Cloud_Layer created with shader Cloud"

'INFO : "Gradient_Layer created with shader Gradient"

関連項目

BlendInTextureLayers BlendInTextureLayersInsp BlendInTextureLayersWithPorts BlendClipsInTextureLayers BlendClipsInTextureLayersInsp BlendClipsInTextureLayersWithPorts