Copy link to clipboard
Copied
Having created a script/tool to help export work from Substance Painter, there is still a left over "gotcha" that I am unsure what/where/why the script won't export the opacity out ask expected.
Example: Create a Substance Painter project, and you need to paint transparency into a window.
Exporting it with the standard Substance -> File -> Export Textures, the resulting textures come out ask expected and desired.
However, exporting with Python API, with, as far as I know, is the same, and correct config for exporting. However only the little spot where the opacity painting had happened shows up in the exported textures.
Noting: Yes, if you fill that layer, or do additional layers to have your transparency paint from, it will export.
The desire is to be able to have it export exactly the same as the created preset.
Here is an example config of what is used for the exports.
{ 'defaultExportPreset': 'AMGIExport',
'exportList': [ { 'exportPreset': 'preset1',
'filter': { 'outputMaps': ['$textureSet_color'],
'uvTiles': [[1, 1]]},
'rootPath': '02_Body/Mask'}],
'exportParameters': [ { 'filter': { 'dataPaths': [ '01_Head',
'02_Body/Mask'],
'outputMaps': [ '$textureSet_color'],
'uvTiles': [[1, 1]]},
'parameters': {'sizeLog2': 11}}],
'exportPath': 'C:/export',
'exportPresets': [ { 'maps': [ { 'channels': [ { 'destChannel': 'R',
'srcChannel': 'R',
'srcMapName': 'basecolor',
'srcMapType': 'documentMap'},
{ 'destChannel': 'G',
'srcChannel': 'G',
'srcMapName': 'basecolor',
'srcMapType': 'documentMap'},
{ 'destChannel': 'B',
'srcChannel': 'B',
'srcMapName': 'basecolor',
'srcMapType': 'documentMap'},
{ 'destChannel': 'A',
'srcChannel': 'A',
'srcMapName': 'opacity',
'srcMapType': 'documentMap'}],
'fileName': 'T_$mesh_$textureSet_D(.$udim)',
'parameters': { 'bitDepth': '8',
'dilationDistance': 10,
'dithering': False,
'fileFormat': 'png',
'paddingAlgorithm': 'infinite'}},
{ 'channels': [ { 'destChannel': 'R',
'srcChannel': 'R',
'srcMapName': 'ambientOcclusion',
'srcMapType': 'documentMap'},
{ 'destChannel': 'G',
'srcChannel': 'G',
'srcMapName': 'roughness',
'srcMapType': 'documentMap'},
{ 'destChannel': 'B',
'srcChannel': 'B',
'srcMapName': 'metallic',
'srcMapType': 'documentMap'}],
'fileName': 'T_$mesh_$textureSet_ORM(.$udim)',
'parameters': { 'bitDepth': '8',
'dilationDistance': 10,
'dithering': False,
'fileFormat': 'png',
'paddingAlgorithm': 'infinite'}},
{ 'channels': [ { 'destChannel': 'R',
'srcChannel': 'R',
'srcMapName': 'Normal_DirectX',
'srcMapType': 'virtualMap'},
{ 'destChannel': 'G',
'srcChannel': 'G',
'srcMapName': 'Normal_DirectX',
'srcMapType': 'virtualMap'},
{ 'destChannel': 'B',
'srcChannel': 'B',
'srcMapName': 'Normal_DirectX',
'srcMapType': 'virtualMap'}],
'fileName': 'T_$mesh_$textureSet_N(.$udim)',
'parameters': { 'bitDepth': '8',
'dilationDistance': 10,
'dithering': True,
'fileFormat': 'png',
'paddingAlgorithm': 'infinite'}},
{ 'channels': [ { 'destChannel': 'R',
'srcChannel': 'R',
'srcMapName': 'emissive',
'srcMapType': 'documentMap'},
{ 'destChannel': 'G',
'srcChannel': 'G',
'srcMapName': 'emissive',
'srcMapType': 'documentMap'},
{ 'destChannel': 'B',
'srcChannel': 'B',
'srcMapName': 'emissive',
'srcMapType': 'documentMap'}],
'fileName': 'T_$mesh_$textureSet_E(.$udim)',
'parameters': { 'bitDepth': '8',
'dilationDistance': 10,
'dithering': True,
'fileFormat': 'png',
'paddingAlgorithm': 'infinite'}}],
'name': 'AMGIExport'}],
'exportShaderParams': False}
Copy link to clipboard
Copied
If there are others scripting export tools with suggestions on simplifying, or tricks and caveats, it is greatly appreciated.