c4d.modules.graphview.GvPort

class c4d.modules.graphview.GvPort

A GvPort is a port of a GvNode-object.

Note

A GvPort object cannot be alive without its owner.
Use GvNode.AddPort() to create a port.

Methods Signatures

GvPort.Connect()

Connects a port with another.

GvPort.Remove()

Removes the connections of this port.

GvPort.GetNrOfConnections()

Get the number of connections, including both the incoming connection and outgoing connections.

GvPort.IsIncomingConnected()

Check if there’s an incoming connection.

GvPort.GetIncomingDestination()

Gets the destination of the incoming connection.

GvPort.GetIncomingSource()

Gets the source of the incoming connection.

GvPort.GetDestination()

Returns the port where the port is linked with.

GvPort.GetNode()

Returns the node of this port.

GvPort.GetName()

Gets the name of this port.

GvPort.SetName()

Sets the name of this port.

GvPort.GetIO()

Gets the IO mode for this port.

GvPort.GetMainID()

Gets the main ID of the port.

GvPort.SetMainID()

Sets the main ID of the port.

GvPort.GetSubID()

Gets the sub ID of the port.

GvPort.SetUserID()

Sets the user ID of the port.

GvPort.GetUserID()

Gets the user ID of the port.

GvPort.GetValueType()

Gets the value type of the port.

GvPort.SetVisible()

Set the visibility of the port.

GvPort.GetVisible()

Checks if this port is hidden or visible.

GvPort.GetUserData()

Internal.

GvPort.SetUserData()

Internal.

Methods Documentation

GvPort.Connect(self, port)

Connects a port with another.

Note

Remember, the nodes of the ports have to be in the same GvNodeMaster, otherwise the connection fails.

Parameters

port (c4d.modules.graphview.GvPort) – The port to connect to.

Return type

bool

Returns

True on succeeded connection, otherwise False.

GvPort.Remove(self)

Removes the connections of this port.

Return type

bool

Returns

True if the connection was removed, otherwise False.

GvPort.GetNrOfConnections(self)

Get the number of connections, including both the incoming connection and outgoing connections.

Return type

int

Returns

Number of connections.

GvPort.IsIncomingConnected(self)

Check if there’s an incoming connection.

Return type

bool

Returns

True if there’s an incoming connection to the port, otherwise False.

GvPort.GetIncomingDestination(self, node, port)

Gets the destination of the incoming connection.

Returns

A tuple with the incoming destination node and the incoming destination port.

Return type

tuple[c4d.modules.graphview.GvNode, c4d.modules.graphview.GvPort]

GvPort.GetIncomingSource(self, node, port)

Gets the source of the incoming connection.

Returns

A tuple with the incoming source node and the incoming source port.

Return type

tuple[c4d.modules.graphview.GvNode, c4d.modules.graphview.GvPort]

GvPort.GetDestination(self)

Returns the port where the port is linked with.

Return type

List[c4d.modules.graphview.GvPort]

Param

A list with all destinations.

GvPort.GetNode(self)

Returns the node of this port.

Return type

c4d.modules.graphview.GvNode

Param

The container

GvPort.GetName(self, node)

Gets the name of this port.

Parameters

node (c4d.modules.graphview.GvNode) – The node the port belongs to

Return type

str

Returns

Port name.

GvPort.SetName(self, name)

Sets the name of this port.

Parameters

name (str) – Port name.

GvPort.GetIO(self)

Gets the IO mode for this port.

Return type

int

Returns

IO mode:

GV_PORT_INVALID

Invalid.

GV_PORT_INPUT

Input.

GV_PORT_OUTPUT

Output.

GV_PORT_INPUT_OR_GEDATA

Input or GeData.

GvPort.GetMainID(self)

Gets the main ID of the port.

Return type

int

Returns

Main ID.

GvPort.SetMainID(self, id)

Sets the main ID of the port.

Parameters

id (int) – New main ID.

GvPort.GetSubID(self)

Gets the sub ID of the port.

Return type

int

Returns

Sub ID.

GvPort.SetUserID(self, id)

Sets the user ID of the port.

Parameters

id (int) – The user ID to set.

GvPort.GetUserID(self)

Gets the user ID of the port.

Return type

int

Returns

Sub ID.

GvPort.GetValueType(self)

Gets the value type of the port.

Return type

int

Returns

The value type.

GvPort.SetVisible(self, v)

Set the visibility of the port.

Parameters

v (bool) – False for an invisible port.

GvPort.GetVisible(self)

Checks if this port is hidden or visible.

Return type

bool

Returns

True if visible, otherwise False.

GvPort.GetUserData(self)

Internal.

New in version R17.048.

GvPort.SetUserData(self)

Internal.

New in version R17.048.