Page MenuHome

Support for keeping preferences of disabled add-ons
Closed, ArchivedPublic

Description

System Information
Operating system:
Graphics card:

Blender Version
Broken: (2.82 Alpha)
Worked: (not sure about if it ever worked)

Note: in 2.7 and earlier F8 reloads the Addons while preserving the preferences. Since F8 no longer works, the issue started getting serious for me at least.

Short description of error

see title

Exact steps for others to reproduce the error

Simple example Addon for testing:

  • install any addon that has one or more addon preferences defined.
  • enable the addon
  • set the preferences to something different from default values
  • store user preferences
  • restart Blender
  • Check that the addon preferences are preserved
  • Disable the Addon
  • Enable it again
  • See that the Addon preferences are reset to their default values
  • furthermore (if Auto save is enabled) the previously stored user preferences have been overwritten by the default settings.

Details

Type
To Do

Event Timeline

You can still reload scripts like in 2.79, it's just not in the default keymap. You can either use F3 (or Edit > Operator Search) to search for Reload Scripts or add the shortcut to your keymap. Preferences will not be affected by reloading through bpy.ops.script.reload()

Yes, i figured out already :) and have added back F8 for me. However i am still a bit concerned about this issue.

For example, when i work with Visual Studio Code and with Jacques Lucke's Blender plugin, every restart of the Addon (F1 -> Reload Addons) resets the presets. this is uncomfortable.

When users update to a newer version of the Addon, they sometimes need to disable the addon, and enable it again, and loose user preference data without any warning. The reload Scripts would help a bit, but you need to know how to find it.

Maybe it is possible to at least add some sort of second choice, so when auto save is enabled, then disabling comes with a small warning like:

"You will loose all presets in the current Blender session when you disable the Addon now. Are you sure about that? If you want to keep your Addon preferences for later, then cancel, disable auto save, then try again. Only then disabling the Addon will do no harm to your preferences. However even then enabling the adodn again still won't add back the user preferences immediately. You will have to restart Blender for that! So are you sure you still want to disable the Addon?"

Ok, ok... You see its a bit uncomfortable as it is right now :)
Is there any chance for improving this ?

I agree with @Gaia Clary (gaiaclary) here. I don't see a good reason for resetting user preferences when disabling and enabling an addon. Maybe there is some implementation detail that makes this difficult, I don't know.

@Campbell Barton (campbellbarton) how hard is it not to reset the preferences of an addon when it is disabled/enabled?

Currently disabling the add-on remove it from the list of add-ons, freeing it's preferences too.

We can change this behavior, either by keeping the preferences at run-time without saving them. Or, keep a list of disabled add-ons which will be used when enabling an add-on - so the preferences aren't lost.

If we always save preferences we will probably want a way to remove unused add-ons preferences, as well as a way to reset the preferences - which will be useful in any case.

Setting this as a TODO.

Campbell Barton (campbellbarton) renamed this task from disable/reenable an Addon resets its preferences back to factory to Support for keeping preferences of disabled add-ons.EditedNov 11 2019, 7:46 AM
Campbell Barton (campbellbarton) closed this task as Archived.
Campbell Barton (campbellbarton) lowered the priority of this task from Needs Triage by Developer to Confirmed, Low.
Campbell Barton (campbellbarton) changed Type from Bug to To Do.

Closing, opened a design task for this T71486: Support for keeping preferences of disabled add-ons.