FindShaders (Material)
Introduced
5.0
Description
Returns all shaders applied to the material that match a filter. If no matching shaders are found, FindShaders returns an empty collection.
Scripting Syntax
Material.FindShaders( Filter )
C# Syntax
ShaderCollection Material.FindShaders( String Filter );
Parameters
|
Parameter |
Type |
Description |
|
Filter |
Name of a shader Filter object. For example, you can use siShaderFilter (the standard XSI shader filter), or you can use a custom filter. |
Return Value
Examples
JScript Example
// Create an object with a texture shader
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 = Application.InstallationPath( siFactoryPath ) +
"\\Data\\XSI_SAMPLES\\Pictures\\xsilogo.jpg";
var imageclip = CreateImageClip( filename, "XSILogo" );
// Find the texture shader using the built-in XSI shader filter
var colShaders= object.Material.FindShaders(siShaderFilter);
var textureshader = colShaders("Image");
// Set up a texture projection and image clip for the texture shader
textureshader.Parameters("tspace_id").Value = "TxtProjection";
textureshader.Parameters("tex").connect(imageclip);
See Also
SOFTIMAGE|XSI v6.01