Author Topic: Possible to reload a mesh in script?  (Read 1698 times)

Can't find any info about refreshing your mesh via script. Normally you'd do it through Edit > Project Configuration > Select...

Any ideas?

Thanks

This hasn't been added to the scripting API yet.
You can do it through a command line option though:
https://support.allegorithmic.com/documentation/display/SPDOC/Command+lines

Nice, thanks for the tip! Command line suits me just as well.

So I gave this a shot, but got some strange results

alg.subprocess.start(["substance painter.exe", "--mesh", meshPath, painterPath])

What this ends up doing for me is opening a new instance of Substance Painter (with the updated mesh) that is somehow tied to the instance that spawned it. I guess through subprocess. If I reload the plugin in the first window, the second window disappears.

Not sure if what I'm doing wrong here... any ideas?

You can't reload a mesh file while Substance Painter is running at the moment.
The only way is was the command line arguments, which start Substance Painter. So obviously in your case you end-up with two instances of the application running.
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.