Shift Path bug in hops

I noticed that hops don’t shift paths the way it happens in the regular grasshopper definitions.
In this example, I have a hops that has only one component inside - PShift.

But when I use this hops on a tree it produces an unexpected result.


shift-path-test.gh (6.5 KB)
shift-test-hops.gh (3.2 KB)

I dug into the issue a little bit deeper and now I’m not sure if this is a bug or a feature :slight_smile:

I want to share a few observations that could help others for better hops cultivation.

  1. Hops knows nothing about branches if a tree structure is supplied to them. Every branch is treated separately and has a path of {0} inside hops. You can feed hops with paths like {0;0;5;0} {0;0;5;1} but it would be converted to {0} for each branch inside.

  2. You can’t flatten or shift path inputs inside hops for the same reason. Hops will flatten and shift paths each branch individually and it wouldn’t make any sense.

  3. You can’t have several branches on input and a different amount on the output. Same reasons.

  4. To develop and test hops all your input data has to be on a path {0}. This is very important, otherwise, you can bump into some merging of shifting problems when using hops with different kinds of data.

  5. If you use ‘relative paths’ inside hops make sure you make it relative to hops.gha not the .gh file! If hops was installed via PackageManager it would be C:\Users\User\AppData\Roaming\McNeel\Rhinoceros\packages\7.0\Hops\0.7.2\