Author Topic: Substance Painter scripting: Export ORM maps  (Read 1206 times)

Hello all,

Last week I started scripting for Substance painter, to improve the workflow in our studio.
I would like to export Occlusion, Roughness and Metallic maps into 1 tga file, but I can't figure out how to do so.
Exporting a single one of those at the time is fine, but there seems to be no way to export them all in seperated channels through scripting.

I also couldn't find any documentation about directly calling presets from within the scripting API.
Can anybody help me with this?
So far I got a list of my materials by calling the alg.mapexport.documentStructure(); command.
After that I'm stuck with the alg.mapexport.save command, witch is only saving one map at the time.

Thanks in advance,

Ron Kamphuis

You can export with the scripting API and specify a custom export preset. So you would simply need to provide in your studio an export preset with your custom packing. Take a look at alg.mapexport.exportDocumentMaps in the scripting documentation.
Don't forget your log file. It can be exported from the Help menu of the software.
-----------
Froyok aka Fabrice Piquet, Technical Artist and Product Designer at Allegorithmic.

You can export with the scripting API and specify a custom export preset. So you would simply need to provide in your studio an export preset with your custom packing. Take a look at alg.mapexport.exportDocumentMaps in the scripting documentation.

There is no such thing as alg.mapexport.exportDocumentMaps in the scripting documentation. Google also didn't give me any results on it.
Could it be something that would be added in a later release?

Edit: I also get an error message if I try to call exportDocumentMaps:
[Script] Property 'exportDocumentMaps' of object [object Object] is not a function
Last Edit: April 07, 2017, 03:43:15 pm

I just figured out that I had to update Substance Painter to the latest version to get access to the exportDocumentMaps function.
It seems to work fine now. Thanks for the help!