Copy Attributes Menu - Disabled Remove Keymap #78189

Open
opened 2020-06-24 02:47:58 +02:00 by Wahyu Nugraha · 4 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.87

Blender Version
Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: blender/blender@211b6c29f7

Short description of error
Disabling the addon does not remove the assigned keymap.
Looking though the .py file it seems like it caused by the mismatched item.name on line 861;

if item.name == 'Call Menu' and item.idname == 'wm.call_menu' and \

instead of;

if item.name == 'Copy Attributes' and item.idname == 'wm.call_menu' and \

itemname.jpg
Apologize if this isn't the cause as I'm not too familiar with python.

Exact steps for others to reproduce the error

  • Uncheck the Copy Attributes Menu addon from the list.
  • Keymap associated with VIEW3D_MT_posecopypopup does not removed automatically (the other 2 entries, MESH_MT_CopyFaceSettings and VIEW3D_MT_copypopup, does get removed automatically).
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.87 **Blender Version** Broken: version: 2.83.0, branch: master, commit date: 2020-06-03 14:38, hash: `blender/blender@211b6c29f7` **Short description of error** Disabling the addon does not remove the assigned keymap. Looking though the .py file it seems like it caused by the mismatched item.name on line 861; ``` if item.name == 'Call Menu' and item.idname == 'wm.call_menu' and \ ``` instead of; ``` if item.name == 'Copy Attributes' and item.idname == 'wm.call_menu' and \ ``` ![itemname.jpg](https://archive.blender.org/developer/F8639811/itemname.jpg) Apologize if this isn't the cause as I'm not too familiar with python. **Exact steps for others to reproduce the error** - Uncheck the Copy Attributes Menu addon from the list. - Keymap associated with VIEW3D_MT_posecopypopup does not removed automatically (the other 2 entries, MESH_MT_CopyFaceSettings and VIEW3D_MT_copypopup, does get removed automatically).
Author

Added subscriber: @Revel

Added subscriber: @Revel
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

I can't replicate the persistence of the keymap, but it is weird that there is no corresponding remove when km.keymap_items.get("pose.copy") is None. So my guess is that the issue exists but I am just unable to reproduce for some reason.
@Revel If you are able to test. Does this work?

diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py
index 0a8705e2..326f80f9 100644
--- a/space_view3d_copy_attributes.py
+++ b/space_view3d_copy_attributes.py
@@ -932,9 +932,11 @@ def unregister():
         kms = kc.keymaps.get('Pose')
         if kms is not None:
             for item in kms.keymap_items:
-                if item.name == 'Call Menu' and item.idname == 'wm.call_menu' and \
-                   item.properties.name == 'VIEW3D_MT_posecopypopup':
-                    item.idname = 'pose.copy'
+                if item.idname == 'wm.call_menu' and item.properties.name == 'VIEW3D_MT_posecopypopup':
+                    if item.name == 'Call Menu':
+                        item.idname = 'pose.copy'
+                    else:
+                        km.keymap_items.remove(item)
                     break

         km = kc.keymaps.get('Mesh')
I can't replicate the persistence of the keymap, but it is weird that there is no corresponding remove when `km.keymap_items.get("pose.copy") is None`. So my guess is that the issue exists but I am just unable to reproduce for some reason. @Revel If you are able to test. Does this work? ``` diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py index 0a8705e2..326f80f9 100644 --- a/space_view3d_copy_attributes.py +++ b/space_view3d_copy_attributes.py @@ -932,9 +932,11 @@ def unregister(): kms = kc.keymaps.get('Pose') if kms is not None: for item in kms.keymap_items: - if item.name == 'Call Menu' and item.idname == 'wm.call_menu' and \ - item.properties.name == 'VIEW3D_MT_posecopypopup': - item.idname = 'pose.copy' + if item.idname == 'wm.call_menu' and item.properties.name == 'VIEW3D_MT_posecopypopup': + if item.name == 'Call Menu': + item.idname = 'pose.copy' + else: + km.keymap_items.remove(item) break km = kc.keymaps.get('Mesh') ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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#78189
No description provided.