Setting Attribute Array for Each Iteration of For Loop

   1627   3   0
User Avatar
Member
11 posts
Joined: April 2017
Offline
Hey y'all!

I am trying to store information in an array, so the next iteration of the for loop is able to use information from the previous iteration in its calculation.

For example, I want to store the position of a point from the previous iteration to an array. So then, I can use the position from “iteration-1” in the calculation of my current iteration. I tried creating a float array attribute for each channel (x, y, z) before the loop begins, then appending the float at the end of the for loop, but it doesn't carry over into the next iteration.

Any thoughts?
Edited by Technically_Jim - May 4, 2020 17:35:16
Jim Watson
Senior Technical Artist
Bend Studio - Sony Interactive Entertainment (SIE)
User Avatar
Member
11 posts
Joined: April 2017
Offline
Found a solution. Creating a meta import node specified to “Fetch Feedback” rather than the default “Fetch Metadata” will return the result of the previous iteration. SUPER helpful.

Quite funny, I have been trying to solve this problem for a couple days, and I find the solution shortly after posting. But I hope if anyone else runs into this issue that this finds you well and its helpful.
Jim Watson
Senior Technical Artist
Bend Studio - Sony Interactive Entertainment (SIE)
User Avatar
Member
8551 posts
Joined: July 2007
Offline
Jim_Watson
Creating a meta import node specified to “Fetch Feedback” rather than the default “Fetch Metadata”
technically Fetch Feedback is the default mode of Block Begin Node

but also depends on what for loop preset you put down
if you do TAB/For-Loop With Feedback then you get Feedback by ‘default’

but yes hitting Create Meta Omport Node will create new Block Begin in Fetch Metadata mode, ultimately it's up to you to pick mode you need for each of the Block Begin nodes
and also Block End whether you want Feedback Each Iteration or Merge Each Iteration
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
11 posts
Joined: April 2017
Offline
Thank you very much for the information! Yeah, I think my main issue was I didn't fully understand what the For-Loop was doing. Now I have a much better understand of the inner workings of it and can therefore get the information that I am looking for much easier.
Jim Watson
Senior Technical Artist
Bend Studio - Sony Interactive Entertainment (SIE)
  • Quick Links