Jump to content

For Each Loop Merge


lyolch

Recommended Posts

Hello Everyone! How can I loop so that the output geometry is used at the beginning of the cycle? Where am I wrong? I only get two dice, but no more .. 
Procedural_house_base.hipnc 

 

 

My result (only 2 blocks)  

WdkyY6qxBbw.jpg

My goal (several blocks with copying on the new ones points )

KWuN6y2sdQg.jpg
Have a good day All 

Edited by lyolch
Link to comment
Share on other sites

  • 4 weeks later...

It's a little unclear what you're trying to do from your file and explanation, but this might point you in the right direction. From what I understand, you're trying to make a loop where each iteration of the loop is based in some way on the previous iteration. Pulling some node from inside of a loop and merging it with the output of the loop is kind of a mess and I would avoid it if possible. If you change your loop end node to "feedback each iteration" instead of "merge each iteration", then the next iteration of the loop comes in with whatever this iteration ended with. You're already assigning each box a unique box_id and you already have the metadata node, so at the beginning of your loop, you can blast everything except the previous box out and do whatever you do with it to make your next box.

It's important that the output of an iteration also includes the results of the previous iterations, though. So, you go back to the start of your loop and merge it with your new box, then feed that to your loop end. The flow of the loops would go something like this:

- The iteration begins with your first box, which has id 0. Blast away everything but box 0 (which changes nothing, because there is only box 0). Something happens using that data, and it produces box 1. Box 1 is merged with the input from the start of this iteration (thus giving you boxes 0 and 1), then fed to the end of this iteration.

- The iteration begins with the output of the previous iteration, boxes 0 and 1. Blast away everything but box 1. Something happens using that data, and it produces box 2. Box 2 is merged with the input from the start of this iteration (thus giving you boxes 0, 1, and 2), then fed to the end of this iteration.

- The iteration begins with the output of the previous iteration, boxes 0, 1, and 2. Blast away everything but box 2. Something happens using that data, and it produces box 3. Box 3 is merged with the input from the start of this iteration (thus giving you boxes 0, 1, 2, and 3), then fed to the end of this iteration.

- [...]

- The iteration begins with the output of the previous iteration, boxes 0, 1, [...], and N-1. Blast away everything but box N-1. Something happens using that data, and it produces box N. Box N is merged with the input from the start of this iteration (thus giving you boxes 0, 1, [...], N-1, and N), then fed to the end of this iteration.

- Iteration N was the last iteration, so you get the output it gave you. Namely, boxes 0 - N.

Link to comment
Share on other sites

Use a SOP Solver and advancing through the frames as you iterator. Put all your operations inside it, merge your previous frame with your current stuff, use groups (with $F of course) to sort things.

If you want the 100th or 1000th iteration just use a Time Shift SOP after the SOP Solver.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...