SIGetMaterialShader

Introduced

v1.0

Description

Gets the shaders connected to the specified material port of the given objects.

Scripting Syntax

oReturn = SIGetMaterialShader( [InputObjs], [Port] );

Return Value

Returns the material shaders as a XSICollection of Shader objects.

Parameters

Parameter Type Description
InputObjs String List of objects.

Default Value: Current selection

Port siMaterialPorts Material port to look for.

Default Value: siMaterialPortSurface

Examples

VBScript Example

CreatePrim "Sphere", "NurbsSurface"

' Apply a default shader to instantiate the material

ApplyShader

' Log the name of the default shader connected to the material Surface:

set s = SIGetMaterialShader( "Sphere", siMaterialPortSurface )

if s.Count > 0 then

For i = 0 to s.Count-1

logmessage "Material Surface shader name: " & s(i).name

Next

else

logmessage "No Material Surface shader found"

end if

'Output of the above script:

'INFO : "Material Surface shader name: Phong"

See Also

SIGetShaderOnCnxPoint