I love grasshopper, but not the bugs on empty branches

I love grasshopper, and I have used it for almost 7 years now. It is an amazing tool.

But the data trees have some really strange behaviors regarding empty branches, which have caused me countless hours of pain! :sweat_smile:

Empty branches are not visible inside clusters

The cluster works as expected but it is easy to introduce bugs when all empty branches are removed.


Expression component adds null to empty branches

Adding empty strings when branch is empty

Is this something that will be different in Grasshopper2? :slight_smile:

9 Likes

+1 on this, thanks for bringing it up! :upside_down_face:

Especially the clusters cause a particular headache. The really weird thing is, the clusters do not actually remove empty branches when in a GH-script. When in the cluster editing all would insinuate they are gone but they are still being processed. Caused hours and hours of debugging and unnecessary workaround before realizing.

Will this be fixed soon? @fraguada

2 Likes

I don’t know. I believe this is more a question for @DavidRutten et al.

Great list, thanks for bringing this up @Alexander_Radne

This one is particularly gnarly - haven’t really found a good workaround except placing dummy data in the empty branches.

C#/Python scripts producing output on empty branches

There have been many topics about that. It’s a shame that this problem still stands. If it’s too complicated to fix I would like to have some component to put before / after the cluster that could do the workaround and recreate the tree structure for me. I’m not an expert on datatrees, clusters add some obscurity to making it even harder - the whole situation makes me somewhat anxious and avoid clusters. I would really like to use clusters and do not worry about that.

2 Likes

I started a new thread this week that reports the same issues, with two GH examples:

@dale bumping this. It’s an old, super annoying bug, please address this.

Empty branches going into a block are removed, i have to populate all my empty branches with nulls before parsing to blocks and then removing them afterwards.

2 Likes

@sonderskovmathias - I’ve opened a ticket for this.

– Dale

5 Likes

@sonderskovmathias Would you have a simple example file (Rhino and GH file preferably) that shows this issue so that I can review it?

1 Like

It can be reproduced easily using this simple setup as in my original post :slightly_smiling_face:

Thanks for giving this attention.

Hi @AndyPayne thanks for looking into this.

Issue 1: When editing a block, empty branches disapear inside edit mode:

On issue 2: I have a python component failing inside my cluster (when NOT editing it) but i can see it turning red on the mouse over preview. I cannot debug what is going on, because as soon as I enter the cluster it works!?

payne.gh (87.1 KB)

1 Like

@AndyPayne any news on this?

Just want to add my +1 to get this fixed. I had to come up with various solutions to work around this in the past.
Don’t have any examples on hand right now though.

2 Likes

@Alexander_Radne I have looked into the first three bugs you reported above. I believe I MAY have found the error in the empty branches when editing clusters issue. I still need to do some more testing there.
However, I wanted to address the other bugs you mentioned (which I don’t believe to be actual bugs). In bug #2, you are feeding the expression component a tree where the first path contains data, but the last three branches are empty. When you pass this into the expression component, it throws an error saying, "Expression generated an error for (x): Left hand value of operator + is Null". This is telling you that the empty branches are getting evaluated as a Null and this is why you’re getting an error. The expression component doesn’t necessarily know how to deal with the empty branch, so it’s just returning a Null item in this case (which is also what you’re seeing on the output side). This isn’t a bug, but rather how the expression component was coded to handle empty branches.
In bug #3, you have a similar setup as #2, only this time you’re using strings and your passing it into the concatenate component. This time, the concatenate component tries to parse the empty branches and rather than throwing an error (like above) it decides to treat the empty branch like an empty string (basically like it’s nothing). So, then it tries to concatenate the strings together and an empty string plus the “;” character just returns basically the “;” character (which is again what you’re seeing on the output side). Again, this isn’t a bug, but rather a conscious decision as to how to treat empty branches (basically show them as empty text strings rather than throw an error).
I hope this helps clear some things up in your original post.

1 Like

Thank you for looking in to this.

Regarding bug 2, 3 and 4:
Thank you for clarifying that this is actually intended behaviour.

However I do find it unintuitive that the list length of branches is changed i would expect it to work sort of like this. So that an empty input branch would yield an empty output branch.

Please don’t mark this as solved until the code has been released and tested.

I created a thread for the same bug, referred to above, in August 2024 (R7) - 1.5 years ago :bangbang:

It was old then. Has this bug been fixed in R7?

P.S. Reading the old thread, I wonder if this actually goes back 4+ years (Jan 2022) :interrobang:
And is the root cause of many bugs :interrobang:

2 Likes

I only looked into bugs #1-3. I haven’t looked into #4 yet and I may punt that one to Ehsan as he’s essentially in charge of the code editors.

I don’t want to outbid you, but this problem has been bothering me since at least 2020… but that’s nothing… the earliest mentions of it date back to 2014… Although, honestly, I think I just accepted not using clusters in Grasshopper 1.

Saying all that, check what David Rutten himself wrote about this problem. My hopes for better clusters moved to Grasshopper 2.

I’m not touching this. Even if a fix would be safe, the breaking behaviour is potentially disastrous.

1 Like

The bug involving empty branches when editing a cluster has been fixed. This should be available in the next release of Rhino 8.30. Sorry for the delay!

1 Like