Author Topic: Automating material export  (Read 281 times)

skg


Can the following sequence of steps be automated via scripting in Substance painter?
1) Create project from template with OBJ + Input Maps
2) Assign smart material to mesh
3) Update all maps through "Resource Updater"
4) Export with premade export settings

Any help with scripting capabilities would be much appreciated.

-
Regards

Hello! (Links below are relative to your install directory)

1. Yes, this can be done. [.../resources/javascript-doc/alg.project.html#.create__anchor]

2. You can get information about smart materials in your layers, but I don't think it's possible to edit them... can someone from Allegorithmic verify this? This is all I'm aware of: [.../resources/javascript-doc/alg.texturesets.html#.structure__anchor]

3. This is possible, though maybe not easily. There is an update method in the API, but I'm suspecting you'd want something more automatic: [.../resources/javascript-doc/alg.resources.html#.updateDocumentResources__anchor]. The good news is, the source code for the entire Resource Updater plug-in is fully available under your plug-ins folder, so you could tweak it or pull things out of it to roll your own.

4. Yes, this is supported. [.../resources/javascript-doc/alg.mapexport.html#.exportDocumentMaps__anchor]

Cheers,

 -- B --

skg


Hi bsilvaLS,
Thank you for your helpful and quick response. Do you know if all the 4 steps can be sequenced and fully automated without requiring any manual input after each step? We would like to write a script that runs all 4 steps one after another and produces the final results at the end of the last step.
--
Regards
skg

Can the following sequence of steps be automated via scripting in Substance painter?
1) Create project from template with OBJ + Input Maps
2) Assign smart material to mesh
3) Update all maps through "Resource Updater"
4) Export with premade export settings
Step 1, 3 and 4 are possible, but step 2 isn't with the current API.
Don't forget your log file. It can be exported from the Help menu of the software.
-----------
Fabrice Piquet aka Froyok. Product Manager, Technical Artist and Documentation at Adobe.

I haven't done it before, but I believe you could sequence 1, 3, and 4 without any manual input. But as Fabrice verified, step #2 isn't possible.

One other consideration -- you could have your plug-in run steps 1, 3, 4 in response to a toolbar button, or when the application starts (through a callback in your plug-in).

But I'd also like to know -- is it possible to run Substance Painter in batch mode, i.e. without raising the UI?

But I'd also like to know -- is it possible to run Substance Painter in batch mode, i.e. without raising the UI?
No, we don't have a batch mode.
Don't forget your log file. It can be exported from the Help menu of the software.
-----------
Fabrice Piquet aka Froyok. Product Manager, Technical Artist and Documentation at Adobe.

skg


Thank you Fabrice and bsilvaLS for the help. We will give this a shot.