How to use Loop Subgraphs in PCG?

Don’t know if you still need an answer but will post the solution for future reference.

Found the answer at 21:30 on this video: https://www.youtube.com/watch?v=Rknnu16mrOw
By Michael Royalty on YouTube.
Video is Definitely worth a watch as this is just a copy of that solution.

I’m not quite sure how the system works but before feeding any data into a loop subgraph it needs to be partitioned which tells the loop what to iterate over . To do this you can employ the attribute partition node. Here’s the basic version I made when I was trying to get the system working (Image A):

NOTE: only allowed 1 image so will place all on 1 and then label with letters

(Almost verbatim from the video)

  1. Assign the Index attribute to a new attribute called Index using the copy attribute node.
    (Image B)

  2. Feed the points data into the Attribute Partition and set the Attribute to Index ( the bit in red is the key to the partition, Each is an item which the loop will iterate over).
    (Image C)

  3. Now you can feed the ‘set’ into the loop subgraph and it will act on everything inside each subset, when using index each subset contains it’s own individual point so it’ll just act on that point (I just copied yours).
    (Image D)

And done!

(Image E)

I see why it is this way because I can imagine some incredibly useful applications with the sets based on groups of attributes but I was stumped for how it work for a good while . I Probably would have remained that way without the video and a little assistance from YouTube transcript to find the right bit! Hope this helps you or anyone else trying to use the Loop Subgraph node!

4 Likes