Empty List operation

I have many lists. Mostly curve or point lists or number. In some cases some lists can be empty. How can I stop the next operation (for example List.Transpose is coming after) when the list is empty or what to do to not have a warning.

If there is always going to be a mix of lists containing either nothing or something you can use a ‘List.Clean’ node with a filter value of False to remove the empty lists from the list of lists before they’re fed into any of the following nodes.

If it is possible that every list in your list of lists is going to be completely empty then its a whole different kettle of fish…

1 Like

@haganjake2 i have seperate lists containing something or nothing. not mixed. if the list has null or empty eitherway the next node has warning. I try to avoid that.

Ah I see - Well in that case your best bet is the Tool.RunMe node:

It requires a boolean input to pass through data for the following task. In the case I’m showing above I’m checking if the list is empty and returning a False value if so. This means rather than passing on the value from the string split it passes a ‘0’.

By virtue of the connection between the nodes within the flow of a visual programming script it is unfortunately not possible to ‘stop’ data flowing down the line if the list is empty. This means that it doesnt necessarily mean your following nodes wont error if they’re receiving a 0 rather than an empty list. But its easier to work with/mitigate the error by doing a further IF check against the output being a 0 or not.

Hope that help/makes sense.

1 Like

@haganjake2 I checked the Tool.RunMe (found in SteamNodes packages)
Whenever I wire the list to the List.Transpose it gives me warning (if it is null or empty)
That made me think that can I solve it without direct wiring. And I think I might have a solution and it actually worked. After null is passed the List.Transpose function without warning it will be binded to other lists and I will List.Clean than. I mean the solution is worked for me.