Bus Nodes / Cable Busses: Reduce cable spaghetti!

So we all have seen it. Cable spaghetti. It’s not a nice thing and currently not an easy task to fix. But maybe there is a nice solution…

So here is the idea:

  • every existing node type gets a new “Bus” input pin (except “Bus” type nodes themselves, see below for what they should feature)
  • a new sort of cable type exists: a “bus” cable - can only be connected from or to a “Bus” pin - this cable is different that any other cable: it does not only transport one data element but any number of named data of any type; it combines multiple cables into one
  • bus cables transport multiple other cables / parameters by pin name; each parameter going in or out of a bus node MUST have a unique name to be identified
  • there are multiple kinds of Bus Nodes:
    • Bus In: has multiple user defined input pins of any type (including bus type!) and one single out that is a bus pin; this is used to form a bus cable
    • Bus Out: has a single Bus input pin and any number of out pins that are of any type (including bus type!) - these out pins split the bus cable into its individual named cables again
    • Bus Select: has many bus inputs and one bus output that is switched by a value
    • Bus Matrix: has n inputs and m outputs (all bus pins) where routing is defined using a matrix and scenarios are switched by a value
    • Bus Filter: has one bus input and 1..n bus outputs. Each output has a filter string assigned: e.g. “name1, name2, name2” → this string defines explicit cable names that shall either be filtered or exclusively selected, a boolean tells whether to either select or filter out cables on the bus by the provided names for each out pin; names in these strings could allow wildcards, e.g. “name*, other?name” so you can match multiple cables using provided name patterns
    • Bus Combine: 2..n bus inputs, 1 out bus; the cables from input bus 1..n are combined to one bus; name collisions are solved by another parameter in the node: first / last: defines the precedence when a collision occurs to select the first cable with the same name or the last one
    • Bus Send / Receive: allows to connect bus cables without actual cables from any point in your graph
    • Bus Info: get the available cable names on a bus as a string, get the cable types on a bus as a string, get the number of transported cables as count [all as separate out pins]

So how does it work?

Each bus cable transports any number of other “cables” (parameters) of any type. Each cable in the bus cable must have a unique name; name clashing is not allowed. You can use a Bus Combine node to filter out collisions when combining busses.

Bus In and Bus Out nodes have any number of in / out pins respectively. These pins define the names of the transported cables (parameters) when forming a bus or splitting it into its individual cables again.
How would you define the custom pins on an Bus In node? The easiest way to define them would be to simply connect a cable from elsewhere to this Bus In by dragging the cable directly onto the node! Then a new pin will be automatically created for that cable using the name of the source pin from which it came from. On name collision a user prompt asks for a unique name and by default adds a number to the current (clashing) name at the end automatically. You can then edit a custom name for that pin. The bus will transport the data of that pin under the name of that pin.
User defined Bus In input pins could also be added using the inspector. Any number of custom type pins with custom names are allowed and this also includes bus type pins! So busses can also transport other busses using a dedicated name for each bus!
The bus out pin of a Bus In node then transports all named data of all input pins in any outgoing bus cable.

When you connect a bus cable to a bus input pin of any node then invisible connections are automatically made using the names transported with the bus. So name matching occurs automatically to select the right cables and all matching names are connected to the same-name input pins of that node. Conversion nodes are invisibly added to convert data where needed. Optionally you could only allow matching name / type data connections and never insert converters.
In order to find out which cables from the bus were connectd to which inputs of that node you have to hover over the connected bus cable (or bus pin) and it will tell you which names exist in that cable and which are actually connected to the node (and where a converter has been added).
In order to NOT connect certain names even when they exist on the target node you can use the Bus Filter node between the target node and the bus cable to select / filter out specific virtual cables in a bus explicitly.

Bus Out nodes on the other hand connect to bus cables and automatically expose any number of out pins using the transported named cables inside the bus. So these nodes will always auto-adapt to the connected bus. Bus Out nodes can be used when explicit cables are required to see what’s inside a bus and to make connections obvious and explicit.

Busses allow a form of “auto-connect” cables using the names of the transported cables. They bundle any number of cables into one and this way reduce the spaghetti a lot. Also - using the Bus Matrix, Bus Select or Bus Filter - they allow complex dynamic re-cabling even during runtime.

Dragging out a cable from an input bus pin of a node onto an empty space on the canvas and then creating a Bus In node would auto-define all input pins of that Bus In node automatically using all existing pins of the source node from where you dragged that cable out. This would help to quickly define required input pins and edit them optionally afterwards.

Optionally (debateble) every node could also feature a “passthrough” bus output pin that provides the input of connected bus cables as output pin to connect other nodes to it. Would allow easy horizontally layed out chaining.

I believe this approach would solve our spaghetti problems once and for all :slight_smile:

Hope you like it!

1 Like