Author Topic: Batch process images through a graph  (Read 48 times)

Hi,

So I built a simple graph in Substance Designer, which takes 2 color image inputs, processes them for my desired result, and outputs 2 "finished" images.  The 2 images can be considered a "set" and I have many of these sets of images. 

Is it possible to use the Batch Tools to feed each "set" of input images to the graph and render my 2 output images in a large batch process?  Each image would be named accordingly, i.e. IMG_001_diff.tif and IMG_001_spec.tif. 

So grab the first set, IMG_001_*.tif, plug the corresponding *_diff.tif into proper input 1, and *_spec.tif into input 2, then render the output images.  Repeat this process for each set within an input directory.

How could I do this?

You can certainly do this.
The general workflow is:
1. Cook your SBS file to an SBSAR file (either in designer or using sbscooker)
2. Call sbsrender and use --set-entry to reference the images you want to use as input.
The call to sbsrender would look something like this:
sbsrender render cooked_sbsar.sbsar --set-entry input1@<path-to-first-image> --set-entry input2@<path-to-second-image>

In the automation toolkits there are wrappers in python for calling sbsrender and sbscooker and if you look at the variations or texture_mat examples you can see how to do it using the batchtools python module. If you prefer the command line route, look at demo_texturingtemplate.py or demos.py.

Let me know if you manage to get it working.