Shader.ImageClips

説明

シェーダまたは子シェーダに接続されている各ImageClipオブジェクトを含むImageClipCollectionを戻します。

C#構文

// get accessor

ImageClipCollection rtn = Shader.ImageClips;

JScript の例

/*

This example illustrates how to enumerate all the image clips affecting a shader, 

either directly or indirectly.

*/

NewScene( null, false );

var root = Application.ActiveProject.ActiveScene.Root;

var obj = root.AddGeometry( "Cylinder", "MeshSurface" );

Selection.SetAsText( obj.Name );

ApplyShader( "Material\\Constant" );

BlendInTextureLayers( "Image" );

var mat = obj.Material;

var shad = mat.Shaders(0);

// Log shader parameters

LogMessage( "Shader: " + shad.FullName );

// Log the image clip used

var cliplist = new Enumerator( shad.ImageClips );

for ( ; !cliplist.atEnd(); cliplist.moveNext() ) {

	LogMessage( "Image Clip: " + cliplist.item().FullName );

}

// Expected results:

//INFO : Shader: cylinder.Material.Constant

//INFO : Image Clip: cylinder.Material.Constant.Image_Layer.Image.noIcon_pic

関連項目

ImageClip Image Material.ImageClips Scene.ImageClips AddImageSource AddImageClip CreateImageClip CreateImageClip2 AddImageTextureLayer AddImageClipFxOp DeleteUnusedImageClips DeleteUnusedImageSources SetImageSource SIAddImageClip SIAddImageSource SICreateImageClip SICreateImageClip2