Connector Class

From Derivative
Jump to navigation Jump to search

The Connector class describes the input or output connection point of an operator. There are two types of connections: those between Components, and those between regular operators. Connections between regular operators can be accessed through the OP.inputConnectors and OP.outputConnectors members. These are the connectors on the left and right sides of Operators. Connections between components can be accessed through the COMP.inputCOMPConnectors and COMP.outputCOMPConnectors members. These are the connectors on the top and bottom of Component operators


Members

indexint (Read Only):

The numeric index of this connector.

isInputbool (Read Only):

True when the connector is an input.

isOutputbool (Read Only):

True when the connector is an output.

inOPOP (Read Only):

Will return any input operators (e.g. inSOP, inCHOP) associated with this connector. This only applies to regular operator connections attached to components.

outOPOP (Read Only):

Will return any output operators (e.g. outSOP, outCHOP) associated with this connector. This only applies to regular operator connections attached to components.

ownerOP (Read Only):

The OP to which this object belongs.

connectionslist (Read Only):

The list of connector objects connected to this object.

descriptionstr (Read Only):

A description for this connection. Example: 'Color Image'.

Methods

connect(target)None:

Wire this connector to a target location. The target may be an operator or another connector.

When the connector is an input, its connection is replaced with the target. When the connector is an output, a new connection is appended to the target.

  • target - The OP or connector you want to connect to.
# connect noise1 to lag1
op('noise1').outputConnectors[0].connect(op('lag1'))

# connect choptotop1 to 2nd input of displace1
op('choptotop1').outputConnectors[0].connect(op('displace1').inputConnectors[1])

# connect geo1 to geo2, two equivalent methods:
op('geo1').outputCOMPConnectors[0].connect(op('geo2'))
op('geo2').inputCOMPConnectors[0].connect(op('geo1'))

disconnect()None:

Disconnect this connector.

op('lag1').inputConnectors[0].disconnect()
op('lag1').outputConnectors[0].disconnect()

# disconnect geo2 from geo1, two equivalent methods
op('geo1').outputCOMPConnectors[0].disconnect()
op('geo2').inputCOMPConnectors[0].disconnect()

TouchDesigner Build: