Multi Data Stream Gate / Referencing Branches

I’m trying to reference a set of culling patterns stored inside 10 panels. So far, an input of one number gives me the panel I want, but I can’t input more than one number at once into the stream gate component.

Essentially, for each number going into this component (or equivalent component), I need the corresponding panel to be added as a branch.

In the second file I’ve tried combining the panels into their own data tree but I still cannot figure out how to reorder/reference the branches in order of the input numbers.

Any help and or insight would be greatly appreciated.

Multi Data Stream (pictured above) (11.5 KB)

Multi Data stream Gate w (7.7 KB)

A couple of pointers…

  1. Avoid passing data through panels. They are great for viewing results but can corrupt (round-off) data values.
  2. In programming, number sequences begin (not end) with zero, so I moved your last panel (“0”) to be the first one.
  3. Right-click ‘Random’ and choose “Integer Numbers”, making sure the domain is constructed correctly. In this case, I used the length of ‘TStat P (Paths)’ with the expression “x-1” on the ‘Construct Domain (Dom) B’ input. This way, you can change the number of input panels without breaking the code. (16.8 KB)

Check this as well.

Multi Data stream Gate w (9.2 KB)

This approach was the first thing I tried too, but it failed for me because I didn’t know about the “Maintain Paths” right-click option in ‘Tree Branch’. Default is checked; un-checking that option causes the paths to be renumbered instead of merged. Very handy! I often learn something reading your code, thank you.

One little quibble though… ‘Entwine’ is a more reliable and predictable way to combine the panels than hooking wires directly to ‘Partition’ because it guarantees the sequence of panels and will handle lists of different lengths. I added the ‘Branch’ method to my previous post (yellow group) while the original remains (blue group). They produce the same results, of course (though paths from blue group have more leading zeroes…). (19.2 KB)