Parameter.ConnectFromProgID2

Introduced

v7.0

Description

Creates a DataSource object from a ProgID string and connects it to the parameter. This method can be used to connect a Shader to a parameter from a ProgID string. It can also be used to connect a multi output shader or shader compound to a parameter, in which case the Parameter object representing the connected source is returned.

Note: This method uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference. Normally for scripting you can get the output arguments via the ISIVTCollection, but this method already returns a value (C# cannot use this workaround because it does not have access to the ISIVTCollection).

The only available workaround in this case is to create a VBScript custom command which returns both the output arguments and the return value in one array. For details, see What Happens when the Function Already Returns a Value?.

C# Syntax

DataSource Parameter.ConnectFromProgID2( String in_ProgID, String in_SourceName, Object& out_pvPrevDataSource );

Scripting Syntax

oDataSource = Parameter.ConnectFromProgID2( ProgID, [SourceName], [PrevDataSource] );

Return Value

Newly created DataSource object, such as a Shader or an ImageClip.

Parameters

Parameter Type Description
ProgID String The ProgID is a string name that can be used to look up a data source type. Data sources that support ProgIDs implement a ProgID property (for example, Shader.ProgID).
SourceName String The name of the source (or output port) on the shader we want to create. Leave empty to connect to default output or for single-output shaders.
PrevDataSource DataSource object (for example, Shader, ImageClip) The previously connected data source if any. The method returns "Nothing" if there is no previously connected data source.

See Also

Shader.ProgID Parameter.Connect Parameter.ConnectFromProgID Parameter.ConnectFromPreset2 Parameter.ConnectFromFile2