Shader.HasRenderer

Introduced

v4.0

Description

Queries the shader as to whether it supports rendering by the specified renderer name.

C# Syntax

Boolean Shader.HasRenderer( String in_Renderer );

Scripting Syntax

oBoolean = Shader.HasRenderer( Renderer );

Return Value

Boolean

Parameters

Parameter Type Description
Renderer String Name of renderer to query support for.

Examples

JScript Example

NewScene( null, false );
oCube = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" );
oShader1 = oCube.Material.surface.ConnectFromProgid( "Softimage.material-lambert.1" );
oShader2 = oCube.Material.shadow.ConnectFromProgid( "Softimage.sib_diffuse_reflection.1" );
LogMessage( "Shader 1 supports mental ray: " + oShader1.HasRenderer( "mental ray" ) );
LogMessage( "Shader 1 supports Cg: " + oShader1.HasRenderer( "Cg" ) );
LogMessage( "Shader 2 supports mental ray: " + oShader2.HasRenderer( "mental ray" ) );
LogMessage( "Shader 2 supports Cg: " + oShader2.HasRenderer( "Cg" ) );
//INFO : "Shader 1 supports mental ray: true"
//INFO : "Shader 1 supports Cg: true"
//INFO : "Shader 2 supports mental ray: true"
//INFO : "Shader 2 supports Cg: false"

See Also

Shader.RendererOptionValue Shader.SymbolName Shader.CodePath Shader.CodeText