Oops, I broke Dynamo's conditional logic engine

Not so much of a problem that requires a solution this one, just wanted to share something bizarre that I just discovered whilst trying to feed a range through an OOTB IF node:

IF statement Logic fail

Anyone ever seen this before?

Is this the beginning of the end??

1 Like

Hi @haganjake2,

You didn’t actually break anything, it’s still the 0…7 list which is coming out of the If result.
However the last item of the list is cut of because there is nothing to compare the item against. (because of the lacing).

I am sorry :slight_smile:

I thought that if the input was true it would output the entire range.

Are you saying it works instead by using the True to pick each item in the range up to the min len() of the True / False input lists?

Yeah (i think), that’s why i never use the If-node, i always use the ScopeIf, or even the ScopeIf+ node from the Clockwork Package.

This has been resolved in 2.12.

If you need to return the full list you return a value of 0 or 1, combine the two lists into a list, and return the list as the resulting index.

In a code block it looks like this:

indx = test ? 0 : 1 ;
rslt = [ trueList, falseList ] [ indx ];

1 Like

Not broken. That’s dynamo.

There is also a Node from the ‚Zebra‘ package which returns the full range.