Author Topic: export_project_textures all texture sets (udims)  (Read 221 times)

hi,
I'm struggling with JSON config that would export all udims (texture sets) for any project. I don't know how many texture sets they are so the JSON config cannot be static and it seems I will have to generate it each time. I cannot find any syntax that would tell the exporter to just do all. If I omit "exportList" entirely or keep it empty then it exports nothing. Is there a syntax that would allow us to export all, regardless of their names?

thank you.

You can simply use substance_painter.textureset.all_texture_sets() to retrieve the list of the project Texture Sets and build your json from there. Like this:

Code: [Select]
Config = {}
Config["exportList"]  = []

TextureSetList = substance_painter.textureset.all_texture_sets()

for TextureSet in TextureSetList :
Config["exportList"].append( { "rootPath" : TextureSet.name() } )
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.

thank you Froyok.
this is exactly what I did - I wrote python generator fo JSON files which kind of makes JSON redundant here. The point of JSON is to write it as a configuration file once and then just statically load to the code. I see no point here for the round trip Python- > JSON -> Python. But it works so I'm happy :-). It is great to finally have Python in Painter and be able to properly pipeline it. Thank you!