- Substance 3D home
- Home
- Command Line Tools
- Command Line overview
- sbsbaker
- sbscooker
- sbsmtools
- sbsmutator
- sbsrender
- sbsupdater
- Command Line overview
- Pysbs - Python API
- Pysbs - Python API overview
- Getting started
- General topics
- Examples
- API Content
- API Content overview
- Substance definitions
- Common interfaces
- compnode
- context projectmgr
- graph
- mdl
- modelgraphindex
- modelannotationnames
- modelgraph
- modelgraphgenerator
- modelgraphimplementation
- modelnodenames
- modeloperand
- modulegraphindex
- moduleannotation
- moduleconnection
- modulegraph
- modulegraphgenerator
- modulegraphimplementation
- modulegraphlibrary
- modulegraphregister
- modulenode
- modulenodeimplementation
- modulenodeinstance
- moduleoperand
- moduleoutputbridging
- moduleparaminput
- params
- projectmgrdoc
- sbsarchive
- sbscommon
- sbspreset
- sbsproject
- substance
- Libraries
- sbsenum
- sbslibrary
- sbsbakerslibrary
- Helpers
- Execution context
- API Change log
- Samples
- Setup and Getting Started
- Integrations
- Substance Maya toolset
- Changelog overview
sbsbaker Example Command Lines
This page contains examples of command lines for various environments to showcase how to invoke the command line processors. In the examples the command line tools are assumed to be in the path.
Bake 1024x1024 ambient occlusion map for a mesh
This showcases an ambient occlusion bake. The main takeaways are:
- Spaces in paths are dealt with slightly different on different platforms. In our examples we use the python subprocess and os.path libraries to make sure these things are dealt with correctly.
- Resolution to the baker is given as N where the resolution is 2^N so if you input 10 the resolution will be 2^10 = 1024
- Any vector data, the resolution in this case, is given as a pair of number separated with a comma. Note that there can be no spaces in these string so an option like "--output-size 10, 10" would generate an error
This call generates a file called mesh_ambient-occlusion.png in the directory the call is made from.
Powershell (Windows)
sbsbaker.exe ambient-occlusion 'C:path with spacesmesh.fbx' --output-size 10,10
Windows command prompt
sbsbaker.exe ambient-occlusion "c:path with spacesmesh.fbx" --output-size 10,10
Linux/MacOSX
sbsbaker ambient-occlusion path with spaces/mesh.fbx --output-size 10,10
Bake 512x512 material color map from a high resolution map to the texture space of a low resolution mesh
This showcases an example of how to bake details from a high resolution mesh to a low resolution mesh. The main takeaways are:
- Some bake operations have both a low resolution mesh and high resolution mesh as an input. This allows having a more detailed mesh when generating maps such as ambient occlusion, normals etc. that doesn't have to be unwrapped. The results will be stored in the texture space of the low resolution.
- Many bake operation have specific options, color-source is only valid for color-from-mesh passes.
This call generates a file called mesh_low_color-from-mesh.png in the directory the call is made from.
sbsbaker color-from-mesh mesh_low.fbx --highdef-mesh mesh_high.fbx --color-source 1 --output-size 9,9
Bake 512x512 material color map from a low resolution mesh
This showcases an example of how to bake a color map without involving a high resolution mesh. The main takeaways are:
- Some bake operations only exists in the from-mesh form. They can still be used without a high resolution mesh by giving the --use-lowdef-as-highdef option.
This call generates a file called mesh-from-mesh.png in the directory the call is made from.
sbsbaker color-from-mesh mesh.fbx --use-lowdef-as-highdef true --color-source 1 --output-size 9,9
Bake 512x512 curvature map and control the name and the image file type
This showcases how to control the name and file type of the generated file. The main takeaways are:
- The bakers can output images in multiple formats
- sbsbaker gives you control over the name
You can integrate input mesh and bake operation names in the generated name if you want using \{bakerName} and \{inputName}. Note that the \{ and \} characters may need special treatment by the shell to avoid problems.
This call generates a file called curvature_mesh_test.tiff in the directory bake_results
Powershell (Windows)
sbsbaker.exe curvature mesh.fbx --output-size 9,9 --output-path bake_results --output-name '{bakerName}_{inputName}_test' --output-format tiff
Windows Command Prompt
sbsbaker.exe curvature mesh.fbx --output-size 9,9 --output-path bake_results --output-name {bakerName}_{inputName}_test --output-format tiff
Linux/MacOSX
sbsbaker curvature mesh.fbx --output-size 9,9 --output-path bake_results --output-name {bakerName}_{inputName}_test --output-format tiff
Sbsbaker run, use a Designer baker preset file as input
With Designer it's possible to save a baker preset file under json format ("Preset">"Save preset" button).
It's also possible to create or edit your own json file (with python as an instance) by respecting the SD preset syntax.
The most advantage of sbsbaker run
is that it keeps meshes file in memory for each baking. If several baking tasks are not parallelized between different machines, sbsbaker run
is by far the fastest way to process several bake on a single machine with SAT.
This file can be pass to the sbsbaker run.
sbsbaker run --json sd_baker_preset.json
Sbsbaker will process each bakers with its parameters present in the json file.
Simple json file:
{
"Ambient Occlusion": {
"baker": "ambient-occlusion",
"parameters": {
"details": 0.6000000238418579,
"normal": "",
"normal-format": 1,
"normal-invert": false,
"normal-world-space": false,
"output-format": "png",
"output-size": {
"height": 11,
"width": 11
},
"quality": 1,
"spread": 0.009999999776482582,
"udim": "1001",
"use-neighbors": false,
"uv-set": 0
},
"sbsindex": 0
},
"Position": {
"baker": "position",
"parameters": {
"axis": 0,
"mode": 0,
"normalization": 1,
"normalization-scale": 1,
"output-format": "png",
"output-size": {
"height": 11,
"width": 11
},
"udim": "1001",
"uv-set": 0
},
"sbsindex": 1
},
"apply-diffusion": true,
"average-normals": true,
"cage-mesh": "",
"dilation-width": 4,
"distance-with": 0,
"ignore-backface": true,
"inputs": "input_mesh.fbx",
"invert-skew": false,
"match": 0,
"max-frontal": 0.009999999776482582,
"max-rear": 0.009999999776482582,
"output-format": "png",
"output-name": "{mesh}_{bakername}",
"output-path": "output_path/directory",
"output-size": {
"height": 11,
"width": 11
},
"relative-to-bbox": true,
"sbsoutput-place-into-specific-folder": false,
"sbsoutput-resource-method": 1,
"skew-correction": false,
"skew-map": "",
"subsampling": 0,
"use-lowdef-as-highdef": true,
"uv-set": 0,
"uvTiles": ""
}