Issues with processing a folder of images using COPs and/or TOPs

   2586   3   3
User Avatar
Member
43 posts
Joined: 12月 2010
Offline
Hey there,

I am creating a digital asset and as part of it I need it to be able to process multiple texture maps in a folder using COPs, and write out the processed images to another folder.
The source folder of images will be different for every instance of the digital asset, and have a varying number of files with incoherent naming conventions and different image types.

My first attempt was to use a standard COP2 network, with a single file cop which has an expression on the file parameter so that on each frame it reads a different file from the folder, then the image gets scaled/processed, then a rop network has a cop rop with an expression on the frame range parameters to render out just the right amount of frames to the new location as there are images in the folder.
However that didn't work at first because the file cop and cop rop nodes can't have expressions depending on time, and these expressions need to change dynamically depending on the folder being scanned.

So then I turned to TOPs, which seems like it was made for this job.. I have successfully made a working TOP network doing pretty much exactly what I want it to do, however once I embed it inside the digital asset and try to force recook the top network from the top level parameter interface, nothing happens at all.
I tried directly promoting the Force Recook button to the top level, and also tried using a callback script to run a python script to trigger the button press on the node.. but neither approach causes the network to cook from that top level of the asset which is where I need it to be cooked from for the user.

Any help and advice would be amazing!
Thanks!
-Mark
MC
User Avatar
Member
385 posts
Joined: 7月 2018
Offline
Chats
turned to TOPs

i am trying to do a similar procedure like a batch process for my textures (not an HDA though), how did you work in TOPs? did you create a COP2net inside the TOPs?
i haven't used TOPs yet so i have no idea how this works
User Avatar
Member
191 posts
Joined: 10月 2018
Offline
papsphilip
Chats
turned to TOPs

i am trying to do a similar procedure like a batch process for my textures (not an HDA though), how did you work in TOPs? did you create a COP2net inside the TOPs?
i haven't used TOPs yet so i have no idea how this works

I'm no expert in TOPs or COPs, but I have a TOP network for scanning folders and converting images to exr, rat, and jpg, and it was made up of a TOP Network > ROP Composite Output. Then inside the ROP Composite Output was:
- COP2 Network (to bring in the image)
- ROP Network (with a composite ROP referencing the cop2net to specify the output of the image)
- ROP Fetch (connected to the input referencing the ropnet comp to actually save the image)
User Avatar
Member
385 posts
Joined: 7月 2018
Offline
i made this simple setup that worked for me

https://www.sidefx.com/forum/topic/77676/?page=1#post-332310 [www.sidefx.com]
  • Quick Links