Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Alex_Che

Pages: [1]
The problem I'm solving right now is very close to mattatttaq problem.

I need to have different variations of textures for the same object. Variations organized in a specific folder as layers so toggling one represents a selection of a specific variant. Basically, the process is to enable a single subfolder in the variant folder then export textures then manually rename it to have a specific texture set for a specific variant. Unfortunately, it is impossible to iterate thru the whole folder via script. So I need to manually export each variation. I'm using a specific variable in the export preset such as $variant as a placeholder for the actual variant name. Then calling subprocess to rename files after export.

Found some problem with alg.subprocess.start
Code: [Select]
let commandPrefix = "cmd.exe /k"
let command = "move /y"
let source = convertFilenameToWindows(file)
let target = convertFilenameToWindows(file.replace(variant, variantValue))
let execution = `${commandPrefix} ${command} \"${source}\" \"${target}\"`
alg.subprocess.start(execution, exportCallback)

When executing cmd.exe with parameters it is not returning any status of execution and not triggering a callback so it continues the execution loop.
As a result when saving after export (which is successful with moving and etc.) Substance Painter process halting.

There is a second approach. Basically, get document structure in JS API  -> get UV tile data from python API -> pass it thru WebSocket to python plugin -> custom export with config dictionary in python. But it is a bit painful rather than just inconvenient. Also, there is no tool to work with export presets which is binary data. Finally, it is impossible to reproduce a fully functional texture exporter which mentioned many times across the forum threads regarding scripting and APIs.

So it would be great you guys share some roadmap regarding API improvement and maybe some estimations because such lame solutions to a problem are not very viable.


Pages: [1]