How do I load multiple sequences in a loop in a compositing network?

   1615   1   0
User Avatar
Member
10 posts
Joined: May 2016
Offline
I would like to load a number of sequences into my compositing network (I have named each sequence with an iteratable folder name). I don't see a for loop available for this network. Can someone suggest how I might load this sequence?
User Avatar
Member
1743 posts
Joined: May 2006
Offline
I can't quite tell if you want to loop footage, or if you want to automatically create lots of file cops pointing to each sub-folder of your render directory.

If its the former, you can use the extend cop, with the post-extend mode set to ‘cycle’.

If its the latter, you'll need to script it. Here's a quick attempt, could be tidied up with dialogs and error checking and whatnot, but the general idea is there:

import os
 
dir = '/path/to/parent/folder'
seq = 'render.$F4.exr'
 
subdirs = [x for x in os.listdir(dir) if os.path.isdir(os.path.join(dir,x))]
 
for d in subdirs:
    imgpath = os.path.join(dir,d)+'/'+seq
    filenode = hou.node('/img').createNode('file')
    filenode.parm('filename1').set(imgpath)

-matt
Edited by mestela - Sept. 7, 2016 11:01:07
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
  • Quick Links