Jump to content

ending a ForEach early


danw

Recommended Posts

Is there any way, within a ForEach SOP set to iterate by number, to force the ForEach to end early? I'm imagining it being possible to set the stamp value to the end condition or some such, but I've no idea if its possible to affect the stamp value directly.

This would create the effect of a While SOP, so if anyone knows an alternative way to hack this, anything would be good. I just need a SOP subnetwork that will iterate until a condition is met, rather than having to be pre-set.

Link to comment
Share on other sites

There is no way you can interrupt the cooking of the operator. To do what you want you basically need to come up with your condition and somehow pass that info to successive iterations.

If you are using Merge Results, then you'd want to let the iterations know to pass nothing to the output. If you aren't merging results then you'd need to let it know to just pass the input geometry through.

Edited by graham
Link to comment
Share on other sites

it´s a bit clumsy but it works. using python would be easier.

petz

Thanks for the link, interesting idea. It looks like it works over successive frames, but I can't see it cutting short the current for loop. I could be being daft however. :-)

From what I can tell, the only robust way to do it is as graham/edward suggest and just have a switch in there to bypass the contents of the foreach and save the time they'd take to cook. Just a shame to waste all those needless iterations cooking the foreach itself, especially if there's a whole lot of redundancy in there.

*sigh*... oh for a While op :-P

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...