You should delete the tab at the front of line “cnt = cnt+1” so that “cnt = 0” and “cnt = cnt+1” have the same indentation level. Once you unmark the while loop, add the tab back so line “cnt = cnt+1” is one level down.
I know this is very subtle. But python scripts execution rely on correct indentation.
Copy the python node from the Custom Node into your graph and test. Unfortunately when wrapped in a CN, exceptions/ warning messages get surprised which disguises problems
You declare list() which isn’t a method or def and that’s likely to be creating the error and subsequent failure of the node. To output multiple objects from a python node, just comma delineate: OUT = view, elements, cnt
Success ! Thanks Thomas. Python no longer broken.
Now to fix my code. It is possible my code wasn’t working because of incorrect indenting. I’ll tackle that tomorrow.