InsertShader

Introduced

v4.0

Categories

shader

Description

Inserts a shader between the supplied port and a shader attached to this port. Any existing shader on the specified port will be moved to the main input port of the shader.

Scripting Syntax

oReturn = InsertShader( PresetObj, InputObjs, [Name] );

Return Value

Returns the newly created shaders.

Parameters

Parameter Type Description
PresetObj String or a preset object (see SIGetPreset) Shader Presets
InputObjs String List of shader connection points.

Default Value: Current selection

Name String Name for the inserted shader

Examples

VBScript Example

' Create a sphere, add a default material and texture projection
NewScene , false
CreatePrim "Sphere", "MeshSurface"
ApplyShader , , , , siLetLocalMaterialsOverlap
CreateProjection "sphere", siTxtPlanarXY, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"
' Connect an image shader to the diffuse port of the Phong
SIApplyShaderToCnxPoint "Image", "Sources.Materials.DefaultLib.Material.Phong.diffuse"
' Insert an invert node between the Phong and the Image node
InsertShader "Image_Processing\Invert", "Sources.Materials.DefaultLib.Material.Phong.diffuse"

See Also

SIConnectShaderToCnxPoint SIApplyShaderToCnxPoint