cosin's picture

Hi, newbie here, as you might imagine. I searched for this in various ways but didn't find anything.

How do you connect a cable to a port, and have that port maintain its original value? I attached an example where SmoothWithDuration is already connected, but if I connect it again it erases the existing value (0).

Or even stranger, another example shows a Mouse Clicks node that outputs 2D points coords, connected to a Select Latest that has custom string inputs, and that's what it outputs, not the 2D points. I tried to set a type but that's not it. What's this sorcery?



Welcome, @cosin :)

jstrecker's picture
Submitted by

Welcome, @cosin :)

In your first screenshot (where the cable is already connected), the cable from Fire Periodically : Fired to Smooth with Duration : Set Position is a thin cable, called event-only. In your second screenshot (where you reconnected the cable), the cable is a thick cable, called data-and-event. The thick data-and-event cable carries more information than the thin event-only cable, namely the data from the Fire Periodically output port (the number of seconds since the composition started). This data overwrites the data in the Smooth with Duration input port. The thin cable, on the other hand, lets the input port keep its data.

To draw the thin event-only cable instead of the thick data-and-event cable, hold down Shift while dragging the cable.

The same thing is going on in your third screenshot. The cables from Receive Mouse Clicks to Select Latest are event-only, so they don't affect the data in the input ports.

If you want the Select Latest to select between 2D points instead of text, you can right-click on one of its ports and choose "Revert to Generic Data Type" (or drag a new Select Latest node from the Node Library), then drag cables from Receive Mouse Clicks to Select Latest. These will be the thick data-and-event cables, and connecting them will change the Select Latest ports to 2D points.

If you're not familiar yet with the concepts of data and events, there's a lot of information about them in the manual.