Preferences - Keymap - "Left/Right Mouse" EXTRA panel #59064

Closed
opened 2018-12-09 11:58:18 +01:00 by Tomasz Muszynski · 15 comments

System Information
Operating system: Win
Graphics card:

Blender Version
Broken: 2.80 2018-12-07

Worked: (optional)

Short description of error
Selecting custom keymap causes disappearance of "Left/Right Mouse..." EXTRA panel.
That can do serious repercussions for add-on based on operators that are placed in that panel.

Exact steps for others to reproduce the error
Preferences -> Input -> Add keykonfig preset ( make any name )
Then "Left/Right Mouse..." extra panel disappears.
Then for example PieMenuEditor add-on that based on operator from that panel causes error:
//Traceback (most recent call last):

File "C:\Users\Tomasz\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\operators.py", line 1889, in invoke
  cpm_key = keymap_helper.to_system_mouse_key(cpm.key, context)
File "C:\Users\Tomasz\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\keymap_helper.py", line 441, in to_system_mouse_key
  default = is_default_select_key()
File "C:\Users\Tomasz\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\keymap_helper.py", line 424, in is_default_select_key
  ret = kc.preferences.select_mouse == 'RIGHT'

AttributeError: 'NoneType' object has no attribute 'select_mouse'

location: :-1

location: :-1//

Even if this is a add-on developer problem he could not have idea that this kind of error can occur.
I advice to leave that EXTRA panel no matter what keymap preset is selected and make it work over the keymap configuration.
I can cause some kind on incoherency when user will edit the keymap that is related to operators form that EXTRA panel.
But for end user is more comfortable to have it all the time.

To fix that coherency you could just disable (inactive) operator buttons that are related to the specific shortcut key but it is not consistent with keymap setup.
For example if user will make custom keymap preset and set P key for Play animation and T for Tools and S for Search then the SPACE button will be "free" and not consistent with any operators form Spacebar Action.
Then all that operators should stay inactive/unselected until user select any of these buttons to override specific keymap config function (Play, Search or Tools) and attach spacebar key to one of these.

Default Keymap preset:
KeymapExtraPanel.JPG

Custom Keymap preset:
KeymapExtraPanel-CustomKeymap.JPG

**System Information** Operating system: Win Graphics card: **Blender Version** Broken: 2.80 2018-12-07 Worked: (optional) **Short description of error** Selecting custom keymap causes disappearance of "Left/Right Mouse..." EXTRA panel. That can do serious repercussions for add-on based on operators that are placed in that panel. **Exact steps for others to reproduce the error** Preferences -> Input -> Add keykonfig preset ( make any name ) Then "Left/Right Mouse..." extra panel disappears. Then for example PieMenuEditor add-on that based on operator from that panel causes error: //Traceback (most recent call last): ``` File "C:\Users\Tomasz\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\operators.py", line 1889, in invoke cpm_key = keymap_helper.to_system_mouse_key(cpm.key, context) File "C:\Users\Tomasz\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\keymap_helper.py", line 441, in to_system_mouse_key default = is_default_select_key() File "C:\Users\Tomasz\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\keymap_helper.py", line 424, in is_default_select_key ret = kc.preferences.select_mouse == 'RIGHT' ``` AttributeError: 'NoneType' object has no attribute 'select_mouse' location: <unknown location>:-1 location: <unknown location>:-1// Even if this is a add-on developer problem he could not have idea that this kind of error can occur. I advice to leave that EXTRA panel no matter what keymap preset is selected and make it work over the keymap configuration. I can cause some kind on incoherency when user will edit the keymap that is related to operators form that EXTRA panel. But for end user is more comfortable to have it all the time. To fix that coherency you could just disable (inactive) operator buttons that are related to the specific shortcut key but it is not consistent with keymap setup. For example if user will make custom keymap preset and set P key for Play animation and T for Tools and S for Search then the SPACE button will be "free" and not consistent with any operators form Spacebar Action. Then all that operators should stay inactive/unselected until user select any of these buttons to override specific keymap config function (Play, Search or Tools) and attach spacebar key to one of these. Default Keymap preset: ![KeymapExtraPanel.JPG](https://archive.blender.org/developer/F5898765/KeymapExtraPanel.JPG) Custom Keymap preset: ![KeymapExtraPanel-CustomKeymap.JPG](https://archive.blender.org/developer/F5898851/KeymapExtraPanel-CustomKeymap.JPG)

Added subscriber: @TomaszMuszynski

Added subscriber: @TomaszMuszynski

Added subscriber: @AleksandrZinovev-2

Added subscriber: @AleksandrZinovev-2

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2018-12-12 15:22:28 +01:00

Indeed the API changed here, and add-ons need to be updated. For the addons that we ship the code was changed to this. For external ones like the pie menu editor it's up to the author.

getattr(kc.preferences, "select_mouse", "LEFT")

This preset panel is not supported for custom keymaps, that was an intentional choice since we can't reliably do such global changes to custom keymaps.

Indeed the API changed here, and add-ons need to be updated. For the addons that we ship the code was changed to this. For external ones like the pie menu editor it's up to the author. ``` getattr(kc.preferences, "select_mouse", "LEFT") ``` This preset panel is not supported for custom keymaps, that was an intentional choice since we can't reliably do such global changes to custom keymaps.

Thank you!

Thank you!

Added subscriber: @LucasVeber

Added subscriber: @LucasVeber

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

Sorry if I'm missing something, but there's still an issue apparently...
Tested with the latest build, after reloading factory settings and deleting any existing custom keymaps.
Please try the following:

  • Open the text editor and paste this code:
import bpy
wm = bpy.context.window_manager
keyconfig = wm.keyconfigs.active
select = getattr(keyconfig.preferences, "select_mouse", "LEFT")
print(select)
  • In the User Preferences, assign the default "Blender" keymap, execute the script, and then assign the "Blender 27X" keymap, execute the script.
    It should have printed in the console, as expected, "LEFT" then "RIGHT" respectively. So far, so good.
  • Create a new keymap
  • Execute the script: "LEFT" is printed, whereas selection is actually using the right click.
Sorry if I'm missing something, but there's still an issue apparently... Tested with the latest build, after reloading factory settings and deleting any existing custom keymaps. Please try the following: - Open the text editor and paste this code: ``` import bpy wm = bpy.context.window_manager keyconfig = wm.keyconfigs.active select = getattr(keyconfig.preferences, "select_mouse", "LEFT") print(select) ``` - In the User Preferences, assign the default "Blender" keymap, execute the script, and then assign the "Blender 27X" keymap, execute the script. It should have printed in the console, as expected, "LEFT" then "RIGHT" respectively. So far, so good. - Create a new keymap - Execute the script: "LEFT" is printed, whereas selection is actually using the right click.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

For custom keymaps you can't know if selection is done using left or right, the code just makes it default to left in that case.

Trying to figure it out automatically in a better way would be nice, but that's not supported at the moment.

For custom keymaps you can't know if selection is done using left or right, the code just makes it default to left in that case. Trying to figure it out automatically in a better way would be nice, but that's not supported at the moment.

Then it's a serious issue... If the user has a custom keymap active, how an addon can know if the user has set left or right click for selection?
There's a bunch of existing addons based on selection, it would break them all.

Then it's a serious issue... If the user has a custom keymap active, how an addon can know if the user has set left or right click for selection? There's a bunch of existing addons based on selection, it would break them all.

(it used to work perfectly in 2.79, so this is clearly a regression...)
Custom keymaps are often used when importing/exporting key maps, it happens all the time when switching computers. Not being able to choose the mouse selection button when using custom keymap is a serious design flaw.
If it's not fixed, bug reports will pile up...

(it used to work perfectly in 2.79, so this is clearly a regression...) Custom keymaps are often used when importing/exporting key maps, it happens all the time when switching computers. Not being able to choose the mouse selection button when using custom keymap is a serious design flaw. If it's not fixed, bug reports will pile up...

Added subscriber: @karab44

Added subscriber: @karab44

HI guys, is there a chance to get this working? Without this functionality many hands are tied. Or at least propose a workaround that works. Thanks.

Best Regards!
Albert

HI guys, is there a chance to get this working? Without this functionality many hands are tied. Or at least propose a workaround that works. Thanks. Best Regards! Albert
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#59064
No description provided.