Jump to content
Sign in to follow this  
lyolch

For Each Loop Merge

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×