Hops, Data Trees and Serialization

I´m currently trying to find a workaround for the lack of data tree support using Hops in Grasshopper.

I have 4 matching trees in terms of path structure but the list length inside that path/branch varies.Two contain geometry the others are like pointers where they tell the definition which object/branch of both geometry trees should be used/combined for calculation.

The structure should stay intact from input to output because its part of bigger definitions which work with the same tree structures.

First i tried serializing the data using jSwan, which isnt the most convenient way. Also only possible on a point level for geometry.
And the other option i tried was wrapping it all up in a Speckle Object serialize it outside and deserialize it inside the Hops definition.

Both ways got rid of the “Shifted out of existence”-Error so i assume inputting the trees worked. But if i directly output the serialized then deserialized items it will be filled using the longest list principle and there are way too many objects in each branch.

Does hops internally know what a DataTree/GH_Strucutre is?
Is there a better/reliable way to use it with trees/nested lists?
Will there be the possibility to get a menu like for C#-Script components (item-list-tree access)?

Hi again,

I’ve got Hops somewhat working with data-trees. It works with 2 lists as input - the first with geometry/data you want to process; the second is a pointer-list which contains the path of each item.

Inside of the Hops definition is a C#-Script that “rebuilds” the data-tree before the rest of the computation.

With Speckle it works with the serialized SpeckleObject and rebuilding the tree structure.

At least to put data in and get data back, but right now only if the data is a string.

Hops:

Input for Hops:

The Speckle-Components are always throwing an exception - “Object not set to an instance of an object”. (I’m fine with that for now because it still computes)

As you can see, right now conversion of the A-output is disabled in the Hops-definiton, at least the text gets processed but geometry does not. If i turn conversion back on no out put will be present and an other exception occurs (red panel):

“2. Solution exception:Collection was modified; enumeration operation may not execute.: component “Speckle Object Value by Key” (bd76c4cb-3f32-4a88-bc18-5823d1335b1d)”

Is there any way to solve this?