Jump to content

fore each loop question


avak

Recommended Posts

Hello,

one question, I created a fore each loop network and for each iteration I want it simulate one peiece from input and write the result on hard disk...seems easy but for me not too easy, please give me some guide

I already created a meta data node and used its iteration number included the file name output in a  rop node (inside the loop)  but it seems it always record the first input result.

 

how to do it ?

Link to comment
Share on other sites

Can you post a hip file?

I am not sure about ROP node, but if you will create fileCache SOP (file mode = Save to Disc) and set the path to Geometry file to something like this (should work)

$JOB/geo/myGeo_`detail("../foreach_begin1_metadata1/","iteration", 0)`.$F.bgeo.sc

 

Edited by kiryha
  • Thanks 1
Link to comment
Share on other sites

Usually in this cases the wedge ROP is the way to go. Without a foreach loop, you need first to delete all the pieces except for the one that you are iterating on and then save it to disk. The wedge ROP will help you to do this for each piece

  • Thanks 1
Link to comment
Share on other sites

I have never tried so don't quote me on this but you should be able to do it. You can put down a "render node network" inside of your HDA and then create the wedge node inside of this one.

 

This way you will carry the wedge setup with your digital asset

  • Thanks 1
Link to comment
Share on other sites

in a python sop you can use the pressButton() argument pointing to your file cache "save to disk" parameter (might have to use evalparm as well) that will in essence physically press the save to disk button on every cook.  combine that with the detail attribute filepath variables and that should be all you need

also you can set a global variable holding your detail expression (under edit menu > aliases and variables > variables), say $CACHE = `detail(blahblah)`, then use $CACHE in your filepath instead of that expression, allowing you to read everything back in as packed prims in a single node using the filemerge sop utilizing that variable (similar to how you can load back in multiple wedge passes)

  • Thanks 1
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...