Camera.GetAllShaders
 
 
 

Camera.GetAllShaders

Introduced

v7.0

Description

Returns all shaders nested under the camera, even the ones that are not connected. If no shaders are found, this method returns an empty collection.

C# Syntax

ShaderCollection Camera.GetAllShaders();

Scripting Syntax

oReturn = Camera.GetAllShaders();

Return Value

ShaderCollection

Examples

JScript Example

// Create a camera and apply a shader to lens
var root = Application.ActiveProject.ActiveScene.Root;
// Create a point light
var light = root.AddLight( "Point", true, "PointLight" );
// Set up the camera with lens flare
var camera = root.AddCamera( "Camera", "Camera" );
translate( camera, 4, 6, 4);
var flare = camera.parameters("lensshader").connectfromprogid("Softimage.FLARES.LEN");
flare.parameters("lights").addvalue(light);
// Get all shaders nested under the camera
var shaders = camera.GetAllShaders();
var eShaders = new Enumerator(shaders)
logmessage( "Number of shaders applied to camera: ");
for ( ; !eShaders.atEnd(); eShaders.moveNext() )
{
        var shader = eShaders.item();
        logmessage( "camera shader: " + shader.progid );
}
//INFO : Number of shaders applied to camera: 
//INFO : camera shader: Softimage.FLARES.LEN.1

See Also

Camera.GetShaderInputType Light.GetAllShaders Material.GetAllShaders Shader.GetAllShaders