Jump to content

Recursive loop and Solver accumulation


Recommended Posts

Hello, I'm trying to accumulate an attribute inside a recursive loop.

I have a geo that enters a feedback loop multiple times and takes modifications.

The loop is in feedback mode so it uses the result of the last loop to modify the geo again.

I have an attribute that changes over time before that loop, and I want, for each iteration in the loop to be able to accumulate this attribute before I modify the geo (because the modifications uses this attribute :) ).

to get something like:

-accum input attribute

-change input with accumulated attribute

-accum first loop iteration attribute

-modify first loop iteration with accumulated attribute

-accum second loop iteration attribute

-modify second loop iteration with accumulated attribute

 

I can not share what I'm trying to achieve, but there is a super simple example file that demonstrates the goal. (I now that in the example I just could put everything outside the loop, it's just for demonstration)

The solver inside the loop kind of work, but become suupppeerrr slow with more complex stuff.

 

Does anyone have an idea how to do this ? 

 

Thank you

RecursiveSolver.hip

Link to comment
Share on other sites

Maybe I can't completely understand what you are trying to achieve. I did simple test: created float attribute before for-each loop equal 100.0 , at each iteration took a square root and added it to result of previous iteration. It works as expected, it accumulate values of attribute at each step, I've got 110, 120.488, 131.465, 142.931, 154.886... and so on. I did not use solver sop at all.

Edited by vicvvsh
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...