McManning/BlueGraph

Add array port views

Opened this issue · 1 comments

I'd like to be able to define a port type as a collection container...

class MyNode: ... {
   [Input] public SomeCollection<float> foo;
}

... and connect edges into individual slots for that collection, essentially to control the order of inputs.

This wouldn't remove the need for the Port.capacity == Multiple feature - since I'd still need singular output ports feed to multiple inputs, or single inputs come from multiple outputs without regard for order (e.g. execution flow). But this would improve usability for handling arrays of things.

The associated PortView should expand to include multiple ports, one per connected element.

I'd rather make this a custom collection type to continue supporting a single edge from an output List<T> to input List<T> and to add IConvertible support for feeding it into a T[] or other enumerable.

The other alternative - if this isn't a core feature - is to just have a custom node that accepts a dynamic list of T inputs and a single T[] output that compiles them into an array. Will probably add this as an example anyway, but it'd be nice to exist as a core feature.