Jump to content
avak

fore each loop question

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 ?

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

@Kiryha, Thanks I will try that way, 

@Andrea, I am using that network inside a digital asset, can I use wedge method inside an HDA ?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

also TOPs can provide easy wedging within an asset if you can use 17.5

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×