Reference Groups with Grasshopper

I’m in a situation where I have a bunch of motion capture data where each “frame in time” is a group of lines/polylines that make up a stick figure. Normally, if I generate geometry in grasshopper and bake the frames/sets as groups, I can window select the groups and “set multiple curves” to a curves parameter and all the elements are in order- they are not in groups, but in one big list (head1,arm1,leg1,head2,arm2,leg2,head3,arm3,leg3…), and I can work with it in this way. But my current situation is that the groups are no longer in order because I have copied some of them and edited others. The contents of the groups usually stays in order, but the order of the groups are out of sequence (head3,arm3,leg3,head1,arm1,leg1,head2,arm2,leg2…).

I don’t want to select each head, arm and leg sequentially in their own curve parameter (to make a list of heads, a list of arms, and a list of legs) since this stick figure is made up of about 30 elements and I have about a hundred frames. I’d be willing to select the hundred groups in order, but not every element in order. The curve parameter will only allow me to select curve in order, not groups of curves. And the groups parameter won’t let me reference anything(what is the point of this component). What do I do?

I’ve mocked up a small model that illustrates my problem. When I window select the groups and “set multiple curves” the contents are in order, but the overall sequence of groups is not from start to finish. I know in this simple situation that I could easily sort some reference point against their X value or some curve rail, but that’s not addressing the issue.

160726 Groups.3dm (75.0 KB)

Generally speaking you should not rely on selection order for consistent geometry order - it cannot be counted on. A sorting approach along the X value or a guide curve is probably the best practice.

However, the problem of loading the group information can be handled easily with the Human plug-in - Just retrieve the “grp” attribute from the Object Attributes and assign it as the data tree path with “assign paths” (from tree frog, bundled with Human). Other attributes may also be of use to you - like the layer or color in order to determine which element is the blue polyline and which is the line.

Hope this helps,

Andrew

2 Likes

The contents within the groups are not the problem, it’s the order of the groups. The rail/guide curve idea could work if I drawn an interpcrv between all the head positions.

It’s a shame that the groups parameter does not accept inputs. I know that my situation is a bit atypical. Normally I try to keep everything in grasshopper until the very end, but I needed to manually smooth out the motion of several frames.

Grasshopper Groups and Rhino groups are actually kind of different concepts - for intstance, an object in rhino can be a part of multiple groups, whereas the same does not apply in Grasshopper.
My suggestion was that you could use a guide curve to sort the order of the groups, not the contents within the groups.

1 Like

Hi @andheum , this tip was very useful to me, as I need to automatically make blocks from groups.
The only problem is that the objects in my groups are already blocks, and HUMAN won’t let me use them as the geometry that constitutes a block :

Any chance you can add that feature soon ?
It would make sense since Human can already reference and analyse nested blocks…