mik74 Posted May 25, 2020 Share Posted May 25, 2020 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 Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 26, 2020 Share Posted May 26, 2020 Hi, is an income value of attribute not changing through the loop iteration, isn't it? If so, why not just to add incoming attribute at each iteration? RecursiveSolver_01.hipnc Quote Link to comment Share on other sites More sharing options...
mik74 Posted May 26, 2020 Author Share Posted May 26, 2020 Hi, thanks for the answer Yeah that's the hard part , the attribute is changing during the loop, and need to accumulate from the previous loop... Don't know if that can be done in houdini. Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 26, 2020 Share Posted May 26, 2020 (edited) 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 May 26, 2020 by vicvvsh Quote Link to comment Share on other sites More sharing options...
mik74 Posted May 26, 2020 Author Share Posted May 26, 2020 Yeah not exactly what I need. I did another scene more clear, closer than what I want if you want to check. Recursivetest.hip Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 27, 2020 Share Posted May 27, 2020 In file two versions - geo_v1 and geo_v2. Try it, maybe this is what you are looking for Recursivetest_01.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.