v1.0
Gets the shaders connected to the specified material port of the given objects.
oReturn = SIGetMaterialShader( [InputObjs], [Port] ); |
Returns the material shaders as a XSICollection of Shader objects.
Parameter | Type | Description |
---|---|---|
InputObjs | String |
List of objects. Default Value: Current selection |
Port | siMaterialPorts |
Material port to look for. Default Value: siMaterialPortSurface |
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" |