How to programmatically disable clusters?

Greetings.

I have a fairly complex definition packaged into clusters. I have a couple of Boolean Toggles and I want them to disable a specific cluster, how can I achieve this?

This is the best way I have found to control the flow of execution in a grasshopper definition. Is there anyway to simulate the Branch node from Unreal Engine in Grasshopper?

A simple Boolean is used to branch the execution flow of the program.

With a smart use of “Stream Gate” you can practically enable/disable a whole wire.
Pass a boolean input to the cluster and put some Stream Gate inside to break/null the data flow.
Stream Gate

2 Likes

There is a component called “Enable/Disable object” in MetaHopper addon (search it on food4rhino). With it you can Enable/Disable any components/cluster.

1 Like

Stream Gate does do this, but it applies to all the data at once. It does sound like that’s what you want though. If however you want to decide whether or not to perform a specific calculation on a per-value basis, then you should use the Sift component. You can then merge all your split data into a single tree again afterwards using the Combine component, while retaining the original ordering.

2 Likes

Thank you so much! It’s working like a charm, I didn’t know Metahopper and it is an absolute beast!

1 Like

Your answer made me take a second look at Stream Gate and Stream Filter as they were not the most intuitive the first time. I got where I wanted using Metahopper and Stream Filter, thank you so much.

Just what I needed, thanks.