
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:
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:
- Is there a better documentation that I'm missing?
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:
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.
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.