BlendInTextureLayersWithPorts

Introduced

v4.0

Categories

shader

Description

Adds new texture layers to the ports to blend in the specified presets.

Scripting Syntax

oReturn = BlendInTextureLayersWithPorts( [PresetNames], [InputObjs] );

Return Value

Returns the layers created as an XSICollection.

Parameters

Parameter Type Description
PresetNames String Shader Presets corresponding to the shaders and/or images you want to connect

Default Value: "Image"

InputObjs String List of shader connections to blend in new layers

Default Value: Current selection

Examples

VBScript Example

'
' This example demonstrates how to apply blended shaders to a specific connection
' point on a cube. It also shows how to access the shader information both from the
' collection returned by BlendInTextureLayersWithPorts and through the object's material.
'
NewScene , false
' Create a default cube and apply a default Phong shader:
Set oBox = ActiveSceneRoot.AddGeometry( "Cube", "MeshSurface" )
ApplyShader , oBox
' Apply Cloud and Gradient presets on the cube's Material Surface port:
Set oLayers = BlendInTextureLayersWithPorts( "Cloud,Gradient", oBox.Material.Parameters( "Surface" ) )
' Now display the name of the created layers:
For Each oLayer In oLayers
        Set oShader = SIGetShaderOnCnxPoint( oLayer & ".color" )
        Application.LogMessage oLayer.Name & " created with shader " & oShader.Name
Next
' View the results in a rendered frame. (The colors appear quite smooth.)
RenderPasses oDefPass, 1, 1
' Set the mode of the Gradient to "Darken":
SetValue oBox.Material & ".Gradient_Layer.mode", 8
' View the results in a rendered frame. (Now the colors seem to have a mottled effect.) 
RenderPasses oDefPass, 1, 1
' Output of above script:
'INFO : "Cloud_Layer created with shader Cloud"
'INFO : "Gradient_Layer created with shader Gradient"

See Also

BlendInTextureLayers BlendInTextureLayersInsp BlendInTextureLayersWithPortsInsp BlendClipsInTextureLayers BlendClipsInTextureLayersInsp BlendClipsInTextureLayersWithPortsInsp