Context menu for button does not display shortcuts with default value of properties #77839

Closed
opened 2020-06-13 19:24:30 +02:00 by Yevgeny Makarov · 13 comments

System Information
Operating system: Darwin-19.4.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 455 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.8.24

Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-05 22:39, hash: b74cc23dc4
Worked: never

Short description of error
The context menu for button does not display some keyboard shortcuts, e.g. for "Insert Keyframe" or "Remove Driver".
Relates to the default value of properties.

context_menu_for_button_shortcut_1.jpg

context_menu_for_button_shortcut_2.jpg

**System Information** Operating system: Darwin-19.4.0-x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 455 OpenGL Engine ATI Technologies Inc. 4.1 ATI-3.8.24 **Blender Version** Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-06-05 22:39, hash: `b74cc23dc4` Worked: never **Short description of error** The context menu for button does not display some keyboard shortcuts, e.g. for "Insert Keyframe" or "Remove Driver". Relates to the default value of properties. ![context_menu_for_button_shortcut_1.jpg](https://archive.blender.org/developer/F8616113/context_menu_for_button_shortcut_1.jpg) ![context_menu_for_button_shortcut_2.jpg](https://archive.blender.org/developer/F8616114/context_menu_for_button_shortcut_2.jpg)
Author
Member

Added subscriber: @jenkm

Added subscriber: @jenkm
Author
Member

For example, if there are menu items:

lang=py
layout.operator("view3d.localview", text="Toggle Local View").frame_selected = False
layout.operator("view3d.localview", text="Toggle Local View (Frame Selected)").frame_selected = True

These hotkeys will be displayed in the menu:

lang=py
("view3d.localview", {"type": 'SLASH', "value": 'PRESS'},
 {"properties": [("frame_selected", False)]}),
("view3d.localview", {"type": 'SLASH', "value": 'PRESS', "alt": True},
 {"properties": [("frame_selected", True)]}),

But this one won't be displayed:

lang=py
("view3d.localview", {"type": 'SLASH', "value": 'PRESS'}, None),
For example, if there are menu items: ``` lang=py layout.operator("view3d.localview", text="Toggle Local View").frame_selected = False layout.operator("view3d.localview", text="Toggle Local View (Frame Selected)").frame_selected = True ``` These hotkeys will be displayed in the menu: ``` lang=py ("view3d.localview", {"type": 'SLASH', "value": 'PRESS'}, {"properties": [("frame_selected", False)]}), ("view3d.localview", {"type": 'SLASH', "value": 'PRESS', "alt": True}, {"properties": [("frame_selected", True)]}), ``` But this one won't be displayed: ``` lang=py ("view3d.localview", {"type": 'SLASH', "value": 'PRESS'}, None), ```

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

Thansk for the report but I don't understand what the bug is here.
Not all operators have shortcuts by default.

This report does not contain all the requested information, which is required for us to investigate the issue.
It's missing:

  • Exact steps to reproduce the bug.

*Guideline for making a good bug report: https:*wiki.blender.org/wiki/Process/Bug_Reports //

Thansk for the report but I don't understand what the bug is here. Not all operators have shortcuts by default. This report does not contain all the requested information, which is required for us to investigate the issue. It's missing: - Exact steps to reproduce the bug. ---- *Guideline for making a good bug report: https:*wiki.blender.org/wiki/Process/Bug_Reports //
Author
Member

These are default shortcuts.

anim.keyframe_insert_button
anim.keyframe_delete_button
anim.keyframe_clear_button
anim.driver_button_remove
anim.driver_button_remove
anim.keyingset_button_add

They work but are not displayed in the button context menu:

context_menu_for_button_shortcut_1.jpg

If you explicitly set the parameter "All" to "True" (which is the same as the default value), the shortcuts will be displayed correctly:

context_menu_for_button_shortcut_2.jpg

These are default shortcuts. `anim.keyframe_insert_button` `anim.keyframe_delete_button` `anim.keyframe_clear_button` `anim.driver_button_remove` `anim.driver_button_remove` `anim.keyingset_button_add` They work but are not displayed in the button context menu: ![context_menu_for_button_shortcut_1.jpg](https://archive.blender.org/developer/F8616113/context_menu_for_button_shortcut_1.jpg) If you explicitly set the parameter "All" to "True" (which is the same as the default value), the shortcuts will be displayed correctly: ![context_menu_for_button_shortcut_2.jpg](https://archive.blender.org/developer/F8616114/context_menu_for_button_shortcut_2.jpg)

This is not really a bug. The operator on the shortcut has different properties than the button, see interface_context_menu.c$579 . (In the button the "all" property is set).
This is a property that can be changed in the Redo panel of some editors.

But it seems reasonable in this case to edit the default keymap to match those buttons.

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index bbbe520441c..1f5613c86bb 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -695,9 +695,12 @@ def km_user_interface(_params):
         ("ui.copy_data_path_button", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True},
          {"properties": [("full_path", True)]}),
         # Keyframes and drivers
-        ("anim.keyframe_insert_button", {"type": 'I', "value": 'PRESS'}, None),
-        ("anim.keyframe_delete_button", {"type": 'I', "value": 'PRESS', "alt": True}, None),
-        ("anim.keyframe_clear_button", {"type": 'I', "value": 'PRESS', "shift": True, "alt": True}, None),
+        ("anim.keyframe_insert_button", {"type": 'I', "value": 'PRESS'},
+         {"properties": [("all", True)]}),
+        ("anim.keyframe_delete_button", {"type": 'I', "value": 'PRESS', "alt": True},
+         {"properties": [("all", True)]}),
+        ("anim.keyframe_clear_button", {"type": 'I', "value": 'PRESS', "shift": True, "alt": True},
+         {"properties": [("all", True)]}),
         ("anim.driver_button_add", {"type": 'D', "value": 'PRESS', "ctrl": True}, None),
         ("anim.driver_button_remove", {"type": 'D', "value": 'PRESS', "ctrl": True, "alt": True}, None),
         ("anim.keyingset_button_add", {"type": 'K', "value": 'PRESS'}, None),

This is something for the Animation team to decide.

This is not really a bug. The operator on the shortcut has different properties than the button, see [interface_context_menu.c$579 ](https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_context_menu.c$579). (In the button the `"all"` property is set). This is a property that can be changed in the Redo panel of some editors. But it seems reasonable in this case to edit the default keymap to match those buttons. ``` diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index bbbe520441c..1f5613c86bb 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -695,9 +695,12 @@ def km_user_interface(_params): ("ui.copy_data_path_button", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, {"properties": [("full_path", True)]}), # Keyframes and drivers - ("anim.keyframe_insert_button", {"type": 'I', "value": 'PRESS'}, None), - ("anim.keyframe_delete_button", {"type": 'I', "value": 'PRESS', "alt": True}, None), - ("anim.keyframe_clear_button", {"type": 'I', "value": 'PRESS', "shift": True, "alt": True}, None), + ("anim.keyframe_insert_button", {"type": 'I', "value": 'PRESS'}, + {"properties": [("all", True)]}), + ("anim.keyframe_delete_button", {"type": 'I', "value": 'PRESS', "alt": True}, + {"properties": [("all", True)]}), + ("anim.keyframe_clear_button", {"type": 'I', "value": 'PRESS', "shift": True, "alt": True}, + {"properties": [("all", True)]}), ("anim.driver_button_add", {"type": 'D', "value": 'PRESS', "ctrl": True}, None), ("anim.driver_button_remove", {"type": 'D', "value": 'PRESS', "ctrl": True, "alt": True}, None), ("anim.keyingset_button_add", {"type": 'K', "value": 'PRESS'}, None), ``` This is something for the `Animation` team to decide.

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Added subscribers: @JulianEisel, @dr.sybren

Added subscribers: @JulianEisel, @dr.sybren

I know pretty much nothing about keymaps. What does {"properties": [("all", True)]} do, and how is it different from None? @JulianEisel can you maybe shed some light on this?

I know pretty much nothing about keymaps. What does `{"properties": [("all", True)]}` do, and how is it different from `None`? @JulianEisel can you maybe shed some light on this?

As I understand it, None in this field means that no property value is set for the operator of that keyitem.
This means that the last property that is defined will remain the next time you call the operator via the shortcut.
(Some properties can be changed in fields such as the operator's Redo Panel).

But taking a closer look, those operators don't even have Redo Panel. So I don't think there will be any changes in the user's point of view.
If this is the case then there is no problem applying this change just to display the shortcut in the context menu.

(It is not a bug. It's just a small visual inconvenience).

As I understand it, `None` in this field means that no property value is set for the operator of that keyitem. This means that the last property that is defined will remain the next time you call the operator via the shortcut. (Some properties can be changed in fields such as the operator's Redo Panel). But taking a closer look, those operators don't even have Redo Panel. So I don't think there will be any changes in the user's point of view. If this is the case then there is no problem applying this change just to display the shortcut in the context menu. (It is not a bug. It's just a small visual inconvenience).

This issue was referenced by a874cec02b

This issue was referenced by a874cec02bbacb27602168328041773f69b6c121

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Germano Cavalcante self-assigned this 2020-06-17 21:31:04 +02:00
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
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#77839
No description provided.