Events and data enter and exit a node through ports


Input ports receive information into a node, and output ports send information out of a node

When an event (and possibly data) is fired from a trigger port and travels along a cable, what happens when it reaches the port on the other end of the cable?

That port on the other end is called an input port. You can think of it as a portal that inputs (receives) information into the node.

In the above composition, the Text input port of the Make Text Image node inputs an event, which causes the node to execute. The Image input port of the Render Image to Window node inputs the event and an image. When the node executes, it uses that image to do its job of rendering an image to a window.

You may have noticed that, in the above composition, some input ports have data that’s attached to the port rather than coming in through a cable. The Text input port has the data Hello World!, and the Font input port has as its data a description of a Helvetica font. These are called constant values because they don’t vary the way that data coming through a cable can. Like data coming in through cables, constant values are also used by the node when it executes. If a port has a constant value, you can edit it by double-clicking on it.

After a node executes, it outputs (sends) information through its output ports. The information outputted — events and possibly data — can then travel along cables from the output ports to other input ports.

On most nodes, every event that comes in through one or more inputs ports goes out of all of the output ports. But there are a couple of exceptions.

One exception is trigger ports. Although trigger ports are output ports, events that come in through input ports are never outputted through them. Trigger ports can only fire new events, not transmit existing events.

The other exception is for nodes whose input ports have thick lines along their right side, which are called event walls and event doors. If an event comes into a node only through an input port with a wall, then the event won’t go out any of the node’s output ports. If an event comes in only through an input port with a door, then the event may or may not go out of some or all of the node’s output ports — the exact behavior depends on the node, and is explained in the node’s documentation.

Both for trigger ports and for walls and doors, the thick line is a hint to remind you that events may be blocked.

The composition below, Select Stripes (File > Open Example > Select), demonstrates one way that event doors can be useful. This composition displays one of two animations at a time, switching between them each time the mouse is pressed. The doors on the Select Input node’s False Option and True Option input ports allow the node to let the stream of events and images from one animation through while blocking the stream from the other animation.

If you’re not sure if a node is letting events through or blocking them, you can enable Show Events or look at Port Popovers to see where events are flowing.