I’ve opened a dedicated topic for that, I’ll try to provide more information ![]()
The preset is saved with is name.
The preset name is the one returned by Resource.name() method
The plugin get preset from dictionary returned by Krita.preset() method
Basically in dictionary:
- Key = preset name
- Value = Resource
Then, when plugin tries to get a preset from a note, it looks in Krita available preset if given name exist.
The plugin does not save the preset configuration itself (currently not possible through API, it need some tweaks that I currently don’t want to implement…)
Issue seems to be fixed, but I can’t confirm it.
The thing is, returned preset from API were using spaces.
And then, for an unknown reason, returned preset from API were using underscores again.
In a scripter, the following code confirmed me the problem:
from krita import *
pdict=Krita.instance().resources("preset")
for k in pdict:
print(k, '==>', pdict[k].name())
When I released v0.4.0 of plugin, preset name were using spaces.
Few days after, when @Konstrukto told me it was not working, tried again on my Windows installation and I saw that preset name were using underscores
Deleting resource file fix the problem: after resource file has been rebuilt, preset names uses spaces again.
I’m not able to determinate what happen here neither exactly when and how: on my installation (and on @Konstrukto installation) the preset names were using underscore again… ![]()
If I found a way to reproduce the problem I’ll inform you ![]()
My initial question for you was more if you’ve already encountered this situation or have an idea of how it could be possible to get back in resource file (I suppose API looks in resource files) preset with underscores…
Grum999