• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Automation API Substance - discontinued??

Community Beginner ,
Jan 28, 2023 Jan 28, 2023

Copy link to clipboard

Copied

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!

 

TOPICS
Scripting

Views

413

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , May 11, 2023 May 11, 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 tha

...

Votes

Translate

Translate
New Here ,
May 07, 2023 May 07, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2023 May 13, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 14, 2023 May 14, 2023

Copy link to clipboard

Copied

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

Mark_Edwards_1-1684130130188.png

 

 

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.

Mark_Edwards_0-1684130006529.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 14, 2023 May 14, 2023

Copy link to clipboard

Copied

LATEST

also if you want to get fancy, you can run sbsrender over as many threads as your gpu can handle from a memory point of view as well, so I'll spawn say 20 at a go using the design pattern above but spawning a thread for each and run them in parallel, also if you have multiple gpu's you can duplicate sbsrender.exe, call it something like sbsrender1.exe and associate that with the other gpu through standard nvidia control panel and then can not only multithread it but distribute over multiple gpu's as well which works well if you have a lot to do quickly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2023 May 13, 2023

Copy link to clipboard

Copied

other than that I'm glad that you confirmed it is possible after all, so I will stick with the task fo trying to figure it out 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines