Support for keeping preferences of disabled add-ons #71451

Closed
opened 2019-11-09 16:11:08 +01:00 by Gaia Clary · 9 comments
Member

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: addon_do_nothing.py

  • 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.

**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: [addon_do_nothing.py](https://archive.blender.org/developer/F8004079/addon_do_nothing.py) - 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.
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary

Added subscriber: @rjg

Added subscriber: @rjg

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 [ https:*docs.blender.org/api/current/bpy.ops.script.html#bpy.ops.script.reload | bpy.ops.script.reload()

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 [[ https:*docs.blender.org/api/current/bpy.ops.script.html#bpy.ops.script.reload | `bpy.ops.script.reload()` ](https:*blender.stackexchange.com/questions/155247/add-shortkey-for-reload-scripts-in-blender-2-80)
Author
Member

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 ?

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 ?
Member

Added subscribers: @ideasman42, @JacquesLucke

Added subscribers: @ideasman42, @JacquesLucke
Member

I agree with @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.

@ideasman42 how hard is it not to reset the preferences of an addon when it is disabled/enabled?

I agree with @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. @ideasman42 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.

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 changed title from disable/reenable an Addon resets its preferences back to factory to Support for keeping preferences of disabled add-ons 2019-11-11 07:46:48 +01:00

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2019-11-11 07:48:23 +01:00

Closing, opened a design task for this #71486 (Support for keeping preferences of disabled add-ons).

Closing, opened a design task for this #71486 (Support for keeping preferences of disabled add-ons).
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71451
No description provided.