If anyone has ever been frustrated by the “If” Node and its inability to lace the longest list, then this topic is probably for you. For a while, I was using “Ayuda.ThisOrThat” from the Rhythm package, but eventually this node was depreciated. Usually this was for signaling a script to run or sending an empty list.
At first, I tried using “Tool.RunMe” from SteamNodes to do this, however this custom node produces a zero when given a “False” input, which using sends an error through the rest of the graph and makes it look like something wrong has occurred.
There’s also the “ScopeIf” Node, which tends to offer buggy results unless used under very specific circumstances.
Nice thing is, I found a rather elegant solution of my own! It also doesn’t require any packages or python to implement.
There you have it, simple as that. You use the basic “If” Node to produce an index, which can then be pulled from a list of two lists. Usually, passing an empty list doesn’t produce an error, so the outcome is still clean. Here is the same thing simplified in a single code block below:
Of course, the Empty List can be switched out with a completely separate one and none of the results even deal with any shortest or longest lacing issues.
Try it out if you feel stumped or would just like a way to simplify your script.
Paste into a Code Block:
run? 0: 1);