OMC::InPort Class Reference

Detailed Description

Represents and provides the methods for a node's in port.

The InPort is a port at the top of a node that accepts incoming connections from another node's OutPort. These are used in order to define a node-graph path between nodes and is the basis of rigging within the application.

Identify all In Ports on a Node

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
proj = sess.project #Get the active session's currently loaded project.
scene = proj.scene #Get the top scene in the project.
peg = scene.nodes["Top/Peg"] #Find the peg node.
#Identify all In-Ports on a Peg
ports_in = peg.ports_in #The in-port list for the node.
for idx,port in enumerate(ports_in):
connection = "NONE"
if port.source_node: #Check if this port is connected to anything.
connection = port.source_node.path
print( "Port %s : %s"%(idx, connection) )


Connect Some Nodes

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
proj = sess.project #Get the active session's currently loaded project.
scene = proj.scene #Get the top scene in the project.
top = scene.top #The top group.
proj.history.begin( "Test Node Connection" )
peg = top.nodes.create( "PEG", "PEG001" )
read = top.nodes.create( "READ", "DRAWING001" )
#Connect the ports!
read.ports_in[0].source = peg.ports_out[0] #Connecting the in port of the read to the outport of the peg.
proj.history.end()

Public Member Functions

virtual OMC::Cablelink (const OMC::OutPort *outPort)
 Connects this in port, to the outport of another node. More...
 
virtual void unlink ()
 Disconnects this port from another other port. More...
 

Public Attributes

bool linked
 True if the port is a dynamic port.
 
bool matte_port
 Identifies if the port is a matte port.
 
OMC::Cablecable
 Provide the cable connected to a port.
 
OMC::Cablecable_flat
 Provide the flattened, read-only cable connected to a port. Ignoring all mutli-port modules and groups.
 
OMC::Portsource
 Get and set the source port that is connected to this port.
 
OMC::Nodesource_node
 Get and set the source node that is connected to this port.
 
OMC::Portsource_flat
 Get the flat source port that is connected to this port.
 
OMC::Nodesource_node_flat
 Get the flat source node that is connected to this port.
 
uint id
 The internal ID of the port.
 
QString type
 The type of the port.
 
uint index
 The index of the port on the node.
 
OMC::Obj node
 The node that owns this port.
 
OMC::Obj node_related
 The node that this port leads to for multiport nodes and groups - the owner node for most node-types, but the the multi-port node for a group, or vice versa.
 
bool inport
 Whether the port is an inport.
 
bool outport
 Whether the port is an outport.
 
OMC::Obj port_related
 The port that this port relates to – itself for most node-types, but the corresponding port on the multi-port node for groups, or vice versa.
 

Member Function Documentation

◆ link()

virtual OMC::Cable* OMC::InPort::link ( const OMC::OutPort outPort)
virtual

Connects this in port, to the outport of another node.

Returns
The cable that connects the nodes, if successful.

◆ unlink()

virtual void OMC::InPort::unlink ( )
virtual

Disconnects this port from another other port.

Inheritance diagram for OMC::InPort:
Collaboration diagram for OMC::InPort: