Material.FindShaders

導入

v5.0

詳細

フィルタに一致するマテリアルに適用されているすべてのシェーダ。一致するシェーダが見つからない場合は、FindShadersが空のコレクションを戻します。

スクリプト 構文

oReturn = Material.FindShaders( Filter );

戻り値

ShaderCollection

パラメータ

パラメータ タイプ 詳細
フィルタ String シェーダFilterオブジェクトの名前。たとえば、siShaderFilter(標準の Softimage のシェーダフィルタ)、またはカスタムフィルタを使用することができます。

JScript の例

/*
        This example demonstrates how to create an object 
        with a texture shader
*/
NewScene("", false);
var root = Application.ActiveProject.ActiveScene.Root;
var object = root.AddGeometry( "Cube", "MeshSurface" );
BlendInPresets( "Image", object, 1, false );
CreateProjection( object, siTxtSpherical, siTxtDefaultSpherical, "TxtSupport", "TxtProjection" );
var filename = XSIUtils.BuildPath(
        Application.InstallationPath(siFactoryPath),
        "Data", "XSI_SAMPLES", "Pictures", "xsilogo.jpg"
);
var imageclip = CreateImageClip( filename, "XSILogo" );
// Find the texture shader using the built-in Softimage shader filter
var colShaders = object.Material.FindShaders(siShaderFilter);
var textureshader = colShaders("Image");
// Set up a texture projection and image clip for the texture shader
SetInstanceDataValue(null, textureshader+".tspace_id", "TxtProjection");
textureshader.Parameters("tex").Connect(imageclip);

関連項目

Material.GetShaderInputType Light.FindShaders