Author Topic: Creating a script for Batching multiple textures through a .sbs or .sbsar  (Read 1934 times)

Hi guys,

I am hoping someone could point me in the right direction..

I have a simple .sbs file that has 1 input and 1 output. I would like to create a script that searches a folder on my computer for everything that ends with "*_Diffuse" and batch the textures through my substance exporting a new texture.

Does anyone know of any good example, tutorials, or websites with more information on something like this?

What would be the best method for doing this? Would I use the batch tools? command line? Is there a way to do this in the player? Any further information would be very helpful!

Here are some links I have been looking at (I was not able to get much information from these links):
http://support.allegorithmic.com/documentation/display/SB10/Sample?src=contextnavpagetreemode

http://www.youtube.com/watch?v=5HuVCi6gf0U


Thank you for your help!

-Daniel Briggs

The max script example is a good place to start.
That part is the one you want to look at:

ShellLaunch "C:\Program Files\Allegorithmic\Substance\BatchTools\1.x\sbsmutator.exe" (
" specialization --input "+folder+"Maps_Compositing.sbs"+" --presets-path "+resourcesPath+
" --connect-image \"Ao\"@path@"+filesAO[compteur] as string+"@tiling@1@format@JPEG@level@0.98"+
" --connect-image \"Curvature\"@path@"+filesCurvature[compteur] as string+"@tiling@1@format@JPEG@level@0.98"+
" --connect-image \"Height\"@path@"+filesHeight[compteur] as string+"@tiling@1@format@JPEG@level@0.98"+
" --connect-image \"Normal\"@path@"+filesNormal[compteur] as string+"@tiling@1@format@JPEG@level@0.98"+
" --output-name "+finalName+
" --output-graph-name "+finalName+
" --output-path "+destination
)

sbsmutator allows you to plug images into inputs of your substance.

Then you can use sbscooker to cook these as sbsar and sbsrender to render the outputs.

You can get all the help in those commands by using the --help argument (sbsrender --help for example).