Tree matching / ignoring branches

This is an issue which I’ve been running into a lot lately and have been working around it but need to solve this properly and am a bit stuck on it.

Have a look at the example below. I have 3 inputs which I combine into one tree where every input should be on it’s own branch. Each input gets a specific compound transformation.

Now, in some cases I don’t get any input on branch 0, 1 and/or 2. In those cases I would still like to match the input to the corresponding transformation and ignore the other ones. For example:

  • only 0 has input and gets transformation {0} applied to it, the other transformations are ignored.
  • only 1 has input and gets transformation {1} applied to it, the other transformations are ignored.
  • 0 and 2 have input and get transformation {0} and {2} applied to the respective input. Transformation {1} is being ignored.

What’s the best way to do this?


110611 ListMatch.gh (9.1 KB)

How about using Entwine instead along with the Filter Unmatched component (Treefrog)?

1 Like

You should be using Entwine instead of Merge.

1 Like

Entwine is what I was looking for, thanks @Rickson & @Joseph_Oster!