Author Topic: Project settings not persisting?  (Read 270 times)

Hello! I'm working on a plug-in, and having some trouble getting project settings to persist. I'm still looking for issues in my code, but I also want to make sure I understand this correctly --

From within my plug-in, if I use the standard:
Code: [Select]
alg.project.settings.setValue("someKey", "VALUE")
then if I save the project, close and re-open Substance Painter, re-open the project, and have my plug-in call:
Code: [Select]
alg.project.settings.value("someKey")
I should get "VALUE" back, correct? Because the setting is baked into the spp file, correct?

I'm getting an undefined value right now.

Any info much appreciated!

Perusing through the existing plug-ins I have (including dcc-live-link), I noticed the only calls I see to alg.project.settings are all in the main.qml file. Is this a requirement? Currently I'm calling it from a QML module window.

As far I know this should work in any part of your code, there is no specific restrictions as to where this piece of code should be called from. The QML window is defined inside the plugin folder or is it an external file you are calling ?
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.

Thanks Fabrice, it was totally my bad... I had a call to alg.settings instead of alg.project.settings, plus some issues with property bindings (I'm still learning QML).

I just did a little test, and you're right -- it can be called from any of my window modules.

Sorry about that, thanks!