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.

Overview

Connection Management

GvPort.Connect()

Connects a port with another.

GvPort.Remove()

Removes the connections of this port.

Connection Routing

GvPort.GetDestination()

Returns the port where the port is linked with.

GvPort.GetIncomingDestination()

Gets the destination of the incoming connection.

GvPort.GetIncomingSource()

Gets the source of the incoming connection.

Connection Status

GvPort.GetNrOfConnections()

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

GvPort.IsIncomingConnected()

Check if there’s an incoming connection.

Node Association

GvPort.GetNode()

Returns the node of this port.

Port Identity

GvPort.GetMainID()

Gets the main ID of the port.

GvPort.GetSubID()

Gets the sub ID of the port.

GvPort.SetMainID()

Sets the main ID of the port.

Port Interface

GvPort.GetIO()

Gets the IO mode for this port.

GvPort.GetValueType()

Gets the value type of the port.

Port Naming

GvPort.GetName()

Gets the name of this port.

GvPort.SetName()

Sets the name of this port.

User Data

GvPort.GetUserData()

Internal.

GvPort.SetUserData()

Internal.

User Identification

GvPort.GetUserID()

Gets the user ID of the port.

GvPort.SetUserID()

Sets the user ID of the port.

Visibility

GvPort.GetVisible()

Checks if this port is hidden or visible.

GvPort.SetVisible()

Set the visibility of the port.

Members

Connection Management

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.

Connection Routing

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.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]

Connection Status

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.

Node Association

GvPort.GetNode(self)

Returns the node of this port.

Return type

c4d.modules.graphview.GvNode

Param

The container

Port Identity

GvPort.GetMainID(self)

Gets the main ID of the port.

Return type

int

Returns

Main ID.

GvPort.GetSubID(self)

Gets the sub ID of the port.

Return type

int

Returns

Sub ID.

GvPort.SetMainID(self, id)

Sets the main ID of the port.

Parameters

id (int) – New main ID.

Port Interface

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.GetValueType(self)

Gets the value type of the port.

Return type

int

Returns

The value type.

Port Naming

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.

User Data

GvPort.GetUserData(self)

Internal.

New in version R17.048.

GvPort.SetUserData(self)

Internal.

New in version R17.048.

User Identification

GvPort.GetUserID(self)

Gets the user 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.

Visibility

GvPort.GetVisible(self)

Checks if this port is hidden or visible.

Return type

bool

Returns

True if visible, otherwise False.

GvPort.SetVisible(self, v)

Set the visibility of the port.

Parameters

v (bool) – False for an invisible port.