What do you do when you are using Get Item from List and you want it to return empty if Which is greater than the list size, instead of grabbing the last item?

Comments

I found a way to do it using

cwilms-loyalist's picture
Submitted by

I found a way to do it using Take from List and Block Empty List but it seems a like a strange way to do something that I think should be default.

I feel like a node setup like this should be possible. Am I missing why this works like this?

Why would you not want it as the default behaviour for lists? If there is a reason for it to behave the current way would it be possible to add a "Block when Empty" switch to the Get Item from List node so we could have it work both ways?

Don't know either if there

Bodysoulspirit's picture
Submitted by

Don't know either if there are some reasons for this to be default behavior, but you could also use Get Item Ranges From List, because ignoring out-of-range items is the default behavior for this node.

If you wanna retrieve 1 element only, hack the make range to have the same min & max (see joined comp).
And if you wanna retrieve several elements, use the make ranges nodes normally (see joined comp 1 & 2).

I think the reason for it

MartinusMagneson's picture
Submitted by

I think the reason for it duplicating the last item in the list is that it makes it easier to deal with point-lists and transforms for instance. With it "remembering" the last instance for the rest you can quickly make a translate array providing only the transforms and adjust rotation and/or scale in one line instead of making separate lists containing the same value. Definable behaviour on the out-port would probably be nice though.