Problem using a For-Loop Stop Condition to test Areas

   1023   2   0
User Avatar
Member
42 posts
Joined: Dec. 2016
Offline
I have a set of floorplanes, I have a target area. I want to run a loop over the input floor planes and once they exceed the floor area I have a stop condition. If I look inside the loop I have the correct result but outside the loop the last prim is missing. Attached is an annotated hip file trying to explain the issue.

I think its a simple issue regarding how I am setting the stop condition or loop but I cannot figure it out

Attachments:
Screenshot 2023-04-20 112814.png (1.4 MB)
AREA_TEST_LOOP.hiplc (189.0 KB)

User Avatar
Member
8581 posts
Joined: July 2007
Offline
as mentioned in docs [www.sidefx.com]
This condition is evaluated before the loop is processed.

which means that loop will look at the stop condition value at the start of the iteration, and if the value is 1 it will not even process the iteration

the fact that you process the same nodes that compose the whole iteration to compute the condition value is irrelevant

to delay the stopping to next iteration, simply feed back the geo to next iteration and check your detail attribute value from fed back geo
since this will happen at the beginning of the iteration, loop will stop as soon as the value passed from previous iteration is 1
meaning that the iteration that produced stop value of 1 will still be processed and output, but the next one will immediately stop

attached fixed file, which also contains alternative solution using loop in detail wrangle instead of foreach sop loop
Edited by tamte - April 21, 2023 04:02:42

Attachments:
AREA_TEST_LOOP_FIX.hipnc (195.7 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
42 posts
Joined: Dec. 2016
Offline
Thank you Thomas! so much appreciated.

I have been using loops for a while but this is stretching my limits of the intricacies in the logic. Hopefully this challenge deepens my conception.
  • Quick Links