Add-ons with keymap entries generate duplicates in keymap
#88518
Open
opened 2 years ago by Toxijuice
·
29 comments
No Branch/Tag Specified
main
asset-shelf
brush-assets-project
blender-v2.93-release
blender-v3.3-release
blender-v3.4-release
xr-dev
blender-v3.2-release
blender-v3.1-release
screenshots-manual
gltf_vtree
blender-v2.83-release
blender-v3.0-release
xr-controller-support
studio-sprite-fright
asset-browser-poselib
blender-v2.92-release
blender-v2.91-release
blender-v2.90-release
greasepencil-addon
xr-world-navigation
soc-2019-openxr
blender-v2.82-release
blender-v2.81-release
filebrowser_redesign
blender-v2.80-release
blender2.7
blender-v2.79b-release
blender-v2.79a-release
blender-v2.79-release
fbx_experiments
blender-v2.78b-release
collada-2
blender-v2.78-release
rigify_fixes
fbx_io_export_ignore_parents
v2.93.14
v3.3.3
v2.93.13
v2.93.12
v3.4.1
v3.3.2
v3.4.0
v3.3.1
v2.93.11
v3.3.0
v3.2.2
v2.93.10
v3.2.1
v3.2.0
v2.83.20
v2.93.9
v3.1.2
v3.1.1
v3.1.0
v2.83.19
v2.93.8
v3.0.1
v2.93.7
v3.0.0
v2.93.6
v2.93.5
v2.83.18
v2.93.4
v2.93.3
v2.83.17
v2.93.2
v2.93.1
v2.83.16
v2.93.0
v2.83.15
v2.83.14
v2.83.13
v2.92.0
v2.83.12
v2.91.2
v2.83.10
v2.91.0
v2.83.9
v2.83.8
v2.83.7
v2.90.1
v2.83.6
v2.90.0
v2.83.5
v2.83.4
v2.83.3
v2.83.2
v2.83.1
v2.83
v2.82a
v2.82
v2.81a
v2.81
v2.80
v2.80-rc3
v2.80-rc2
v2.80-rc1
v2.79b
v2.79a
v2.79
v2.79-rc2
v2.79-rc1
v2.78b
v2.78a
v2.78
v2.78-rc2
v2.78-rc1
v2.77a
v2.77
v2.77-rc2
v2.77-rc1
v2.76a
v2.76
v2.76-rc3
v2.76-rc1
v2.75
v2.75-rc2
v2.75-rc1
v2.74
v2.74-rc4
v2.74-rc3
v2.74-rc2
v2.74-rc1
v2.73a
v2.73
v2.73-rc1
v2.72
v2.72-rc1
v2.71
v2.71-rc1
v2.70a
v2.70
v2.70-rc
v2.68
v2.67b
v2.67a
v2.67
v2.66a
v2.66
v2.65a
v2.65
v2.64a
v2.64
v2.63a
v2.63
v2.62
v2.61
v2.60a
v2.53
v2.54
v2.55
v2.56
v2.56a
v2.57
v2.57a
v2.57b
v2.58
v2.58a
v2.59
v2.60
v2.69
Labels
Apply labels
Clear labels
good first issue
legacy module/Animation & Rigging
legacy module/Core
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/User Interface
legacy module/VFX & Video
legacy project/2.81
legacy project/2.82
legacy project/2.83
legacy project/2.90
legacy project/2.92
legacy project/2.93
legacy project/3.0
legacy project/3.1
legacy project/3.2
legacy project/3.4
legacy project/Add-ons (BF-Blender)
legacy project/Add-ons (Community)
legacy project/Alembic
legacy project/Animation & Rigging
legacy project/Asset Browser
legacy project/Automated Testing
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Blender Cloud
legacy project/Code Quest
legacy project/Collada
legacy project/Compositing
legacy project/Core
legacy project/Cycles
legacy project/Datablocks and Libraries
legacy project/Dependency Graph
legacy project/Documentation
legacy project/EEVEE & Viewport
legacy project/Freestyle
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Physics
legacy project/Game Python
legacy project/Game UI
legacy project/Geometry Nodes
legacy project/Good First Issue
legacy project/Grease Pencil
legacy project/Images & Movies
legacy project/Import/Export
legacy project/Infrastructure: Blender Buildbot
legacy project/Infrastructure: Blender Web Assets
legacy project/Infrastructure: Websites
legacy project/Modeling
legacy project/Modifiers
legacy project/Motion Tracking
legacy project/Nodes
legacy project/Nodes & Physics
legacy project/OpenGL Error
legacy project/Overrides
legacy project/Papercut
legacy project/Physics
legacy project/Pillar
legacy project/Pipeline, Assets & I/O
legacy project/Platform: Linux
legacy project/Platform: macOS
legacy project/Platforms, Builds, Tests & Devices
legacy project/Platform: Windows
legacy project/Python API
legacy project/Render & Cycles
legacy project/Render Pipeline
legacy project/Sculpt, Paint & Texture
legacy project/Straightforward Issue
legacy project/Text Editor
legacy project/Tracker Curfew
legacy project/Translations
legacy project/USD
legacy project/User Interface
legacy project/UV Editing
legacy project/VFX & Video
legacy project/Video Sequencer
legacy project/Virtual Reality
papercut
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information from Developers
Status › Needs Information from User
Status › Needs Triage
Status › Resolved
straightforward issue
Type › Bug
Type › Design
Type › Known Issue
Type › Patch
Type › Report
Type › To Do
No Label
good first issue
legacy module/Animation & Rigging
legacy module/Core
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/User Interface
legacy module/VFX & Video
legacy project/2.81
legacy project/2.82
legacy project/2.83
legacy project/2.90
legacy project/2.92
legacy project/2.93
legacy project/3.0
legacy project/3.1
legacy project/3.2
legacy project/3.4
legacy project/Add-ons (BF-Blender)
legacy project/Add-ons (Community)
legacy project/Alembic
legacy project/Animation & Rigging
legacy project/Asset Browser
legacy project/Automated Testing
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Blender Cloud
legacy project/Code Quest
legacy project/Collada
legacy project/Compositing
legacy project/Core
legacy project/Cycles
legacy project/Datablocks and Libraries
legacy project/Dependency Graph
legacy project/Documentation
legacy project/EEVEE & Viewport
legacy project/Freestyle
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Physics
legacy project/Game Python
legacy project/Game UI
legacy project/Geometry Nodes
legacy project/Good First Issue
legacy project/Grease Pencil
legacy project/Images & Movies
legacy project/Import/Export
legacy project/Infrastructure: Blender Buildbot
legacy project/Infrastructure: Blender Web Assets
legacy project/Infrastructure: Websites
legacy project/Modeling
legacy project/Modifiers
legacy project/Motion Tracking
legacy project/Nodes
legacy project/Nodes & Physics
legacy project/OpenGL Error
legacy project/Overrides
legacy project/Papercut
legacy project/Physics
legacy project/Pillar
legacy project/Pipeline, Assets & I/O
legacy project/Platform: Linux
legacy project/Platform: macOS
legacy project/Platforms, Builds, Tests & Devices
legacy project/Platform: Windows
legacy project/Python API
legacy project/Render & Cycles
legacy project/Render Pipeline
legacy project/Sculpt, Paint & Texture
legacy project/Straightforward Issue
legacy project/Text Editor
legacy project/Tracker Curfew
legacy project/Translations
legacy project/USD
legacy project/User Interface
legacy project/UV Editing
legacy project/VFX & Video
legacy project/Video Sequencer
legacy project/Virtual Reality
papercut
Priority › High
Priority › Low
Priority › Normal
Priority › Unbreak Now!
Status › Archived
Status › Confirmed
Status › Duplicate
Status › Needs Information from Developers
Status › Needs Information from User
Status › Needs Triage
Status › Resolved
straightforward issue
Type › Bug
Type › Design
Type › Known Issue
Type › Patch
Type › Report
Type › To Do
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
10 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-addons#88518
Reference in new issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 466.27
Blender Version
Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-19 16:30, hash:
blender/blender@0456223cdeWorked: Unsure, tested 2.91.2 and it also has the issue.
Short description of error
Importing keymap creates duplicate entries
Exact steps for others to reproduce the error
All Keymap option)Result: The large amount of key bindings in Node Editor section of keymap created by NodeWrangler is now doubled. Exporting and Importing the keymap again will triple the bindings, and so on.
Expected: The addon key bindings are not doubled when importing the keymap.
Added subscriber: @Toxijuice
blender/blender#89945 was marked as duplicate of this issue
blender/blender#94180 was marked as duplicate of this issue
Added subscriber: @PratikPB2123
@Toxijuice , can you check again with 2.93 LTS
Added subscriber: @Toxijuice-3
Just tested on 2.93 LTS, it still occurs.
Changed status from 'Needs Triage' to: 'Confirmed'
Thanks for checking. Tested again, now I can reproduce the problem.
Adding ~8-9 Keyconfig presets will help to reproduce the problem.
Added subscribers: @Rawalanche, @Branskugel
This is not NodeWrangler specific issue, this is issue with keymap entries added by any addon. If you merge my report into this one, then at least name it correctly. Otherwise, the name of the task implies it's a lot smaller problem than it really is.
Node Wrangler creates duplicate entries in keymap when creating new Keyconfig presetto Add-ons with keymap entries generate duplicates in keymap when creating new Keyconfig preset 1 year agoAdded subscriber: @Hologram
Indeed, considering the many bugs related to corrupting the keymap this one may be most severe.
If you are unaware, it will eventually inflate the keymap's file size by quite a lot. When trying to clean up my keymap file, I noticed it had increased from ~400KB to 694KB. Editing it becomes such a mess with items going missing, see: https://developer.blender.org/T94618 that I decided to manually rework the entire thing, which will be over a couple of days worth of work...
The unfortunate reality is that anyone serious about a custom keymap (beyond a slight modifications of the default one) will sooner or later resort to manual editing of the .py file in a code editor rather than using the keymap editor in Blender because there's just way too many way too serious keymap corruption bugs :(
By the way, this bug also occurs when enabling > disabling > re-enabling addons (such as node-wrangler) that create keymap entries upon enabling the addon. This makes it so that duplicate items will emerge. So there are two methods that can corrupt the keymap.
This still occurs on Blender 3.0.
I don't think people are aware of the severity of this particular bug, just check the other task I mentioned and you will see that there are some serious unforseen consequences to this.
Removed subscriber: @Branskugel
Add-ons with keymap entries generate duplicates in keymap when creating new Keyconfig presetto Add-ons with keymap entries generate duplicates in keymap 1 year agoAdded subscribers: @IihT2cWA9xiP30BsYphz3EiEISNoScoe, @filedescriptor, @twonumbers
Grease Pencil Tools and Material Utilities, both bundled with Blender suffer from the same problem as Node Wrangler, I'm compiling the full list here: https://developer.blender.org/T89945
And notice, it also happens without 'Export all Keymaps' checked.
Added subscriber: @TR4
@PratikPB2123 could the duplication bugs for keymaps when exporting the keymap and enabling/disabling addons please be fixed for Blender 3.2?
Hello @Hologram , unfortunately I don't know the fix (not investigated yet)
it's actually a long standing bug (oldest report I found was blender/blender#45578 (Duplicate Addons Hotkeys)) so I can't guarantee that it'll get fixed sooner :)
@PratikPB2123 I think I understand the cause of the issue and why sometimes addons do and sometimes do not create duplicates.
It is actually surprisingly simple in principle and related to this bug: https://developer.blender.org/T86228.
If you enable an addon, it adds a keymap entry to Blender's default keymap. Since Blender does not differentiate between keymaps during editing (it changes all keymaps globally rather than one individually) it means Blender adds a keymap item. When exporting the keymap, it exports this entry. When importing this keymap, it adds a second entry to the keymap, because Blender initially added one with the addon and that's still being processed.
On the other hand, if the addon's keymap item is removed before importing the exported keymap, it does not create a duplicate. Then, it only imports one item, since there is no other item to process. As soon as duplicates exist, they stack up when importing/ exporting.
Steps to reproduce
Keymap Duplication_Rendered0001-6234.mp4
Also, for addons which have preferences to change the keymaps, duplicates can emerge when the preferences do not correspond to the keymaps. In other words, if I have preferences saved with a shortcut set to X, though I have a keymap with the shortcut set to Y, importing the latter adds the shortcut for Y. Resulting in both X and Y entries in the keymap. The keymap with Y can be created by manually changing the keymap and exporting and quitting Blender without saving the preferences.
Disabling a keymap item has the same effect, because this prevents the merger of the two and is especially apparent in modals, where they end up stacking new duplicate entries which are all enabled (each export adds 1 additional item for every disabled keymap).

For example:
But it does not happen here:

I can elaborate on all of this if needed.
Added subscriber: @ideasman42
Hi, thanks for the investigation.
Not sure who is the active developer in this area. Maybe @ideasman42 ?
If so, can you share your thoughts?
I would also like to emphasize that certain addons (e.g. Nodewrangler) currently require you to make changes to the default Blender keymap, because if you export the keymap that you edited, it adds a long list of duplicates that have the default keymap settings (from Blender's default keymap). So, in order to import a custom keymap, you have to delete all Node Wrangler entries from Blender's keymap. This is a side-effect from this bug.
But, it also means that if I exported my keymap (with the "All Keymaps" option unchecked) I am not able to import this particular input in a factory state Blender, because the default keymap would contain entries for Node Wrangler when the addon is enabled OR the custom keymap does not contain the entries, because they were created in the default keymap. This thus defeats the purpose of exporting keymaps when add-ons are involved!
I really do hope that all the keymap related bugs will be addressed as one, because I fear that solving a single one does not resolve the mess entirely due to their interrelatedness.
Added subscriber: @Nurb2Kea
Added subscriber: @GeRo