ImageClip.GetShaderParameterTargets

ImageClip.GetShaderParameterTargets

導入

v7.0

詳細

イメージクリップ出力に接続されているオブジェクトを含む ParameterCollection を戻します。これにより、Render Tree が Parameter.Source プロパティとは反対の方向に移動されます。

C#構文

ParameterCollection ImageClip.GetShaderParameterTargets();

スクリプト構文

oReturn = ImageClip.GetShaderParameterTargets();

戻り値

ParameterCollection

JScript の例

/*

	This example creates a sample shader tree that uses 3 image clips and shows 

	how to get to which input parameters thoses image clips are connected. An image clip

	can be shared across different materials.

*/

NewScene(null, false);

//Create 4 Image Nodes

SIApplyShaderToCnxPoint("Image", "Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse", null, null);

SIApplyShaderToCnxPoint("Image", "Sources.Materials.DefaultLib.Scene_Material.Phong.ambient", null, null);

SIApplyShaderToCnxPoint("Image", "Sources.Materials.DefaultLib.Scene_Material.Phong.specular", null, null);

SIApplyShaderToCnxPoint("ScalarImage", "Sources.Materials.DefaultLib.Scene_Material.Phong.shiny", null, null);

//Create 3 Image Clips From File

SICreateImageClip("\Pictures\\chrom[1..3].tga", null, null);

SICreateImageClip("\Pictures\\cloud02.pic", null, null);

SICreateImageClip("\Pictures\\refmap2.tga", null, null);

//Connect the first 2 Image Clip to different Shader Input Parameters 

SIConnectShaderToCnxPoint("Clips.chrom_1__3__tga", "Sources.Materials.DefaultLib.Scene_Material.Image.tex", false);

SIConnectShaderToCnxPoint("Clips.cloud02_pic", "Sources.Materials.DefaultLib.Scene_Material.Image1.tex", false);

//The last Image Clip is connected to 2 input parameters.

SIConnectShaderToCnxPoint("Clips.refmap2_tga", "Sources.Materials.DefaultLib.Scene_Material.Image2.tex", false);

SIConnectShaderToCnxPoint("Clips.refmap2_tga", "Sources.Materials.DefaultLib.Scene_Material.ScalarImage.tex", false);

//Remove No-Icon from this material

DisconnectAndDeleteOrUnnestShaders("Clips.noIcon_pic", "Sources.Materials.DefaultLib.Scene_Material");

//Now Get the Image Clips and use the GetShaderParameterTarget method to get where they are connected.

var oCloudClip, oChromeClip, oRefMapClip, oNoIconClip;

SICreateImageClip("\Pictures\\refmap2.tga", null, null);

oCloudClip = GetValue("Clips.cloud02_pic");

oChromeClip = GetValue("Clips.chrom_1__3__tga");

oRefMapClip = GetValue("Clips.refmap2_tga");

oNoIconClip = GetValue("Clips.noIcon_pic");

//Cloud and Chrome Should be connected to 1 target.

var oCloudClipTargets, oChromeClipTargets;

oCloudClipTargets = oCloudClip.GetShaderParameterTargets();

oChromeClipTargets = oChromeClip.GetShaderParameterTargets();

LogMessage( "Cloud and Chrome Should be connected to 1 target." );

LogMessage( "Cloud is connected to " + oCloudClipTargets.Count + " Target(s)." );

LogMessage( "Chromeis connected to " + oChromeClipTargets.Count + " Target(s)." );

//RefMap Should be connected to 2 targets.

var oRefMapClipTargets;

oRefMapClipTargets= oRefMapClip.GetShaderParameterTargets();

LogMessage( "RefMap Should be connected to 2 targets." );

LogMessage( "RefMap is connected to " + oRefMapClipTargets.Count + " Target(s)." );

//NoIcon Should be connected to 0 target.

var oNoIconClipTargets;

oNoIconClipTargets= oNoIconClip.GetShaderParameterTargets();

LogMessage( "NoIcon Should be connected to 0 target." );

LogMessage( "NoIcon is connected to " + oNoIconClipTargets.Count + " Target(s)." );

関連項目

Shader.GetShaderParameterTargets Parameter.Source