HasRenderer (Shader)

Introduced

4.0

Description

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

Scripting Syntax

    Shader.HasRenderer( Renderer )

C# Syntax

    Boolean Shader.HasRenderer( String in_Renderer );

Parameters

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

Return Value

Boolean

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

Autodesk Softimage v7.5