for each doing both merge and fetch update?

   2975   3   0
User Avatar
Member
79 posts
Joined: Feb. 2008
Offline
I'm not sure how to deal with a particular situation. I'm building an HDA with 2 inputs, a list of curve, and a mesh. I need to generate 2 outputs, a new list of curve and an updated mesh.

Here's where I'm stuck. I'm trying to use a foreach loop to loop through each input curve. Each curve generates a new set of curves that are merged on each iteration, but I also want these curves to update the mesh on each iteration.

So the first curve generates new curves using the original input mesh, then these new curves updates the mesh topology and then we go to the next curve, it generates new curves using that updated mesh topology, then these new curves updates the mesh topology again, and so forth until we looped through all the curves and then I want to return the new curves and the last updated mesh.

The foreach nodes gives us a choice of Merge Each Iteration or Feedback Each Iteration where I'm trying to do both. Also the foreach loop outputs just one object, where I need it to output two (the new curves and the updated mesh).

Any recommendations on how I can set this up?
User Avatar
Member
79 posts
Joined: Feb. 2008
Offline
I guess I could tag the curves and the mesh, merge them together, loop through the tags with a fetch feedback, split the mesh and the current curve based on the metadata, generate my new curves, change my topology and merge everything back together to prepare for the next loop. That's the only way I see this working. Any better suggestions?
User Avatar
Member
9378 posts
Joined: July 2007
Offline
you can have Iteration Method set to By Pieces and Gather Method to Feedback

2 Block Begins (Fetch Piece, Fetch Feedback)

and to get “multioutbput” just pack your “output” geos separately and at feedback or after for loop split and unpack them (in example file I repurposed Groom Pack/Unpack for that purpose)

Attachments:
ts_foreach_perpiece_feedbck_multioutput.hip (181.2 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
79 posts
Joined: Feb. 2008
Offline
That's a fantastic example. It does exactly what I want, and shows me a few cool tricks I didn't know. Thanks for that.
  • Quick Links