Clean Tree Not Working on Text - Bug?

Hi, I believe I’ve come across a bug.

Clean Tree is not removing the empty paths in this text.

I believe this is happening because my text has null fields when I am concatenating them?

clean_tree_not_working_on_text.gh (23.5 KB)

I don’t think this is a bug, even if it’s an unfortunate behavior :upside_down_face:

you are right, Clean Tree will remove Nulls, but after going through Concatenate you don’t have Nulls anymore but empty strings, which are not removed

same you can say indeed about the branches, they contain empty strings so they contain something

given both initial data streams have very same structure, I guess you could do something like this, cleaning the Trees upstream?

clean_tree_not_working_on_text_re.gh (16.9 KB)

otherwise if data was not matching (or just to stay on the safe side) I would do something like this:

clean_tree_not_working_on_text_re2.gh (17.6 KB)

1 Like

But shouldn’t an empty string be seen as an empty branch that has be removed? Grasshopper already does something similar with Text Entity, where if you make a text entity without giving a text it will create an ‘Invalid Text Entity’ which either can be cleaned via ‘Clean Tree’ or be identified with ‘Null Item’. I would imagine that an empty text string could also be treated similarly?

Also, yes its not too much of a workaround for me right now atleast as the data structure before concat is the same and your other solution helps when the structures arent the same. You are right this is probably not a bug, but it is unintuitive to not have ‘Clean Trees’ remove anything that is empty. If the text string is not actually empty it should not show up as empty but rather as ‘Invalid Text’ which can then be cleaned as you do with the Text Entity.