u/Serana64

Scripting questions

Original post:

I am looking into making python Substance Painter plugins; I am an experienced programmer and I have worked with QT6 & PySide6, so I am familiar with that side of things.

So far, the only documentation I have found is here:

https://adobedocs.github.io/

However, I can find a lot more details by looking in the .py code in modules, which is the only way I can see to navigate the API.

I would like to make a dirt simple plugin focused on QOL UI improvements (particularly the ability to edit fonts / themes, which is easy in PySide6 but perhaps not in Painter API).

A few questions:

  1. Is there a better documentation that I'm missing?
  2. Is it possible to get syntax highlighting for this, e.g a QTCreator SDK?

----

UPDATE: Solved, albeit I'd still love some better documentation.

Thankfully, someone's gone and generated the pip files for this already.

https://pypi.org/project/types-substance_painter/

Just run in your venv:

pip install types-substance_painter

I cloned one of the examples on adobedocs.github.io and I added:

def start_plugin():
    global BLEND_MODES
    win = sp.ui.get_main_window()
    win.setStyleSheet(win.styleSheet() + "* { color: blue; }")

And sure enough, it worked:

https://preview.redd.it/og9y7xohzc1h1.png?width=504&format=png&auto=webp&s=ff9911869a070c31b8b45a1bc02c4b129eb31027

Now I can attempt a theme editor. Wish me luck.

Update 2:

Ok, I was able to pretty easily make a plugin that dumps the entire application's USS into a file and reads from another non-destructively. Now I can use USS to edit the theme.

https://preview.redd.it/taf03zsqed1h1.png?width=1915&format=png&auto=webp&s=c04ee5820c9619ce0e1dc955c094c3a9e4bbfb76

I'm sure there are a billion plugins out there that do this, but if someone's interested in this dirt simple one, let me know and I'll dump the source.

reddit.com
u/Serana64 — 6 days ago