I'm looking for the equivalent of Build List output from inside a loop using the Process List node. Or in QC terms, the Iterator Variables patch.

Say I have a list of images and I want to locate them according to the order they appear in the list. (Please note I can't use Arrange in Grid/Row/Column because they either resize the image or position it in a way that isn't suitable to me).

I want to use X position maths like coordinates of (X, 0) where:

  • X = starting_X + (i * spacing / count_of_list)

  • i is the incrementing value of the loop

  • starting_X is coordinate of the left-most image in the list
  • spacing is the units between each image
  • count_of_list is total number of items in list.

Comments

I don't have my Vuo-station

unicode's picture
Submitted by

I don't have my Vuo-station handy right now to make sure this solution works, but here's what I'd try:

  • make a 'Count' node, set values 'Increment'=1, 'Set Count'=0
  • make an event-only cable from the 'Process Item' output to the 'Increment' input
  • make an event-only cable to 'the 'Set Count' input from whatever's feeding the list into 'Process List'
  • make a 'Hold Value' node
  • connect its refresh port to 'Process Item' and connect its 'New Value' port to the output of 'Count'

I think this setup will give you an output which resets to 0 whenever a new list hits the 'Process List' node, and then increments with each iteration through the list. When 'Count' receives an event on its 'Set Count' port, it would inject an extra event into the loop which wasn't created by the 'Process List' node, so the 'Hold Value' should suppress that.

Hope this helps! :D

It work! Thanks. It also

useful design's picture
Submitted by

It work! Thanks. It also helped me realise any values coming into the loop from outside seem to need Hold Value nodes on them in the same way to stop spoof values getting in and messing with the first item of the iteration. Wow that was very helpful because that's weird first-element-in-list-is-wrong thing has been bugging me for days now!

I'm adding an example comp for those who come after me. If we remove the "bottom" and " Hold Value nodes and wire those values directly into the loop we get a "Hello World!" text image in the list of layers.

Hold Value nodes very important for loops..vuo