For-loop with feedback: saving geo from each stage

   1247   4   0
User Avatar
Member
94 posts
Joined: 1月 2015
オフライン
I have a for-loop, driven by its iteration count, that feeds back onto itself for many iterations. I want to save a geo sequence for each iteration stage. My current plan: 1) plug a geometry ROP to the output of the loop, 2) inside the loop, jut before the output, insert a Python node that triggers the ROP's "Save" button. If there are better approaches, please let me know
Edited by element33 - 2025年2月14日 09:22:04
User Avatar
Member
802 posts
Joined: 2月 2017
オフライン
put $F in the iteration value. Then write a cache sequence with the same length to disk. done.

Cheers
CYTE
User Avatar
Member
94 posts
Joined: 1月 2015
オフライン
CYTE
put $F in the iteration value
I tried it first, but it's inefficient. If I save a frame range to a File Cache from the loop's output, on each frame, the for-loop starts from the very beginning. E.g. on frame 10, it goes through 9 iterations: 1-9. I want the for-loop to run only once, efficiently, saving a geo for each iteration.
Edited by element33 - 2025年2月14日 09:39:26
User Avatar
Member
9390 posts
Joined: 7月 2007
オフライン
You can use File SOP inside of your loop
Set to Write mode with filename dependent on your iteration
Then you should be able to write out a sequence per each iteration

If however you just want a single sequence when each iteration is a frame then Solver SOP may be more convenient
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
109 posts
Joined: 8月 2017
オフライン
Not 100% sure what you're doing, but I'd recommend looking into TOPs, it has a For-Loop With Feedback top. If I'm not mistaken, Entagma did a paid course on it "PDG 101 – Pt.16: Feedback Loops" where they rendered out an image and fed it back to the loop as a texture. SOP and TOP for-loops could have virtually identical results, but a sop for-loop will most likely freeze your houdini without any info on how things are going. PDG is the way to go whenever exporting and re-importing anything.

Edit: gave it a shot out of curiosity. Attaching a hip.
Edit2: Attaching an second hip that supports an animated sequence.
Edited by alexmajewski - 2025年2月16日 14:23:58

Attachments:
feedback_loop.hiplc (427.9 KB)
feedback_loop_animated_sequence.hiplc (437.1 KB)

  • Quick Links