Skip to main content
Participating Frequently
January 28, 2023
Answered

Automation API Substance - discontinued??

  • January 28, 2023
  • 2 replies
  • 927 views

Hi all, I really need help in automating/ batch outputting the texture maps from a list of sbs or sbsar files. I can no longer donwload Automation Toolkit, so all the videos online are outdated. What is the process for Automating now? It is so poorly documented after they closed access in September 2022 and I am really lost. I am trying to something like below. I have no idea where the files the video mentions have gone or if they are even in the latest Substance installations.

 

https://www.youtube.com/watch?v=lYgKVXKHImQ

 

thank you!

 

This topic has been closed for replies.
Correct answer Mark_Edwards

not sure on current state of automation tool kit but for what you are trying to do you can use sbsrender which comes with standard designer subscription and run that either on command line or I call it via python it's same commands as the version included in automation tool kit  sbsrender | Substance 3D Automation ToolKit (adobe.com) you can pass the parameters you exposed in you graph.  Takes a bit of fiddling about to figure it out but it works well, I regularly pas 30-40 + parameters like that with no problems in batch jobs.  if you are on windows there are in ```C:\Program Files\Adobe\Adobe Substance 3D Designer``` by default. 

2 replies

Mark_EdwardsCorrect answer
Inspiring
May 12, 2023

not sure on current state of automation tool kit but for what you are trying to do you can use sbsrender which comes with standard designer subscription and run that either on command line or I call it via python it's same commands as the version included in automation tool kit  sbsrender | Substance 3D Automation ToolKit (adobe.com) you can pass the parameters you exposed in you graph.  Takes a bit of fiddling about to figure it out but it works well, I regularly pas 30-40 + parameters like that with no problems in batch jobs.  if you are on windows there are in ```C:\Program Files\Adobe\Adobe Substance 3D Designer``` by default. 

Participating Frequently
May 13, 2023

thanks a lot for the response Mark. After a lot of digging i was able to find out about SBSRender being usable without Automation toolkit, along with some examples of it being used. I tried to find a python developer to help me as I don't know how to code, and tried running a few scripts that I made but nothing worked for me. I just wanted a script that ran through a list of SBS files and exported the outputs into the pre-assigned folders. Do you happen to know of such script, or have some advice of how to create one, I could pass it to my developer if so! 

 

thanks so much for replying either way. 

Cheers

Inspiring
May 15, 2023

hard to do succinctly here :-), will try.

 

there are lots of "gotchas" to get going but once you have those sorted it's easy.

 

Main issues are the formatting of the string you pass the command line is not that obvious.

 

Unless things have changes you have to be careful to force image inputs to be of the size you want and most importantly the bit depth especially for height and position maps I set it to absolute 16bit in my graph.

 

Once the graphs get more complicated you quickly get lost trying to find the imports so I break all mine out.

I try and keep as much logic and calculations in the python script as I can and pass the results and avoid doing complicated function graphs where I can so it's easier to manage and more visible whats going on.

 

Here's basic python example, I like to build the command line like this so it's easy to read, this is assuming you have the archive and associated files in the same directory as your python script.  I've just put a few examples with comments you should be able to derive the rest from these.

 

for color the easiest way to do it is create a float 4 input and hook that up to a standard color node then you can just pass the float values to that and use the color node line normal in the graph

 

 

import os
import subprocess

script_path = os.path.abspath(__file__)

script_dir = os.path.dirname(script_path)

render_path = os.path.normpath(R"C:\Program Files\Adobe\Adobe Substance 3D Designer\sbsrender.exe")

output_path = script_dir

color_1 = [1.0,0.0,0.0,1.0]

args =[]

args.append(render_path)

args.append("render")

args.append("--input")
args.append(os.path.join(script_dir, "batch_example.sbsar"))

# {outputNodeName} is an internal sbsrender substitution not a python
# format command so make sure to escape it properly if using format
# it replaces with the output node name from the graph so if you have 
# multiple outputs they don't over write each others
args.append("--output-name")
args.append(os.path.join(script_dir, R"test_name-{outputNodeName}"))

# pass any files first note it's set entry not set value
args.append("--set-entry")
args.append("image_1@{}".format(os.path.join(script_dir, "image_example.png")))

# $outputsize is substance designer internal variable
# sizes are in power of 2 so 11 is 2048x2048
args.append("--set-value")
args.append("$outputsize@{0},{0}".format(11))

# $randomseed is substance designer internal variable
args.append('--set-value')
args.append("$randomseed@{}".format(0))

# gets passed as a string so get's interpreted as float or int
# by the setting of the input node (if you have bool input just pass 0 or 1)
args.append("--set-value")
args.append("number_value@{}".format(1))

# for vectors/arrays flatten out into comma separated
# string which then gets interpreted correctly
args.append("--set-value")
args.append("color_1@{}".format(','.join([str(f) for f in color_1])))

try:
    subprocess.run(args,check=True, stderr=subprocess.PIPE)
except subprocess.CalledProcessError as e:
    print(e.stderr.decode())

 

example of what I mean by breaking out the inputs, as your graphs get more complicated it becomes really hard to track.

 

Participant
May 7, 2023

I also have this issue, would really appreciate some help!