[Proposal] Enhanced Cluster Interface(With Callback Function)

What I’m asking for is 2 extra param inside cluster definition, which function just like Input/output, but stream data to/from outside in the middle. Something like this:
Inside:

Outside

out

These essentially allow you to take a function as cluster input, which might lead to some interesting application.
Aside from being a niche for Graph Mapper, it could help create a more robust and sophisticated cluster. For example:
multi

And more stupid Functional one.
emmmm
I was trying to implement this some days ago and realized it’s impossible to change some arbitrary component’s attribute. But I get the impression that it won’t be very difficult to implement in native GH, since it doesn’t conflict with existing logic, and there already has the input/output param. Major work should mainly involve some attribute change. Backward compatibility might be a thing, but can be addressed with a default built-in function.
So I wonder if it could be an official feature come in future version. :thinking:

1 Like

Before we start, I want to make it clear I’m not agreeing or committing to anything…

How about instead of an entirely new wire/connection paradigm, I make component networks themselves a data type? You can then either define a graph mapper on canvas and turn it into a sort of injectable cluster, or even load a graph mapper from the disk and use it inside some cluster.

There’s still plenty of issues to do with input/output topology when it comes to hooking up something like this, but conceptually it would allow you to create lambda functions (either dynamically or loaded from files) and use them.

(I’m on an iPad now, but I can mock up some visuals when I get to the office)

1 Like

Yeah, exactly what I want :smile:

That’s why I end up with this kind of workaround. How could this be solved?
Looking forward to seeing the mockup :grinning:

Very naive, haven’t given much thought about the connection topologies:

Thanks for replying!
following your direction, I actually made something that works. :laughing:


Also add a built-in loop function. Work perfectly for me :3 There still plenty of problems, but I manage to solve some with other hacky components.
However, the major problem is that It can’t work inside a cluster :neutral_face:
So How should I get the sources of an input hook? Can’t find anything about Kernel.Special in grasshopper SDK…
There is a relevant question here: How to differ a (Clustered) GH_ScriptComponent's InParam from a ClusterInput?
but hasn’t got an answer yet