difining an operator as text.myoperator doesn't enable setting shortcut from context menu. #49800
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#49800
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have an addon where I used operators with a path text.myoperatorname.
When defining a panel with the buttons, in right-click menu there wasn't the possibility to add shortcut.
when I changed the operator path to object.myoperatorname, shortcuts are enabled.
submitting just the addon in version where it works:
macros.py
this is not working (operators with text.something)
macros_bad.py
Changed status to: 'Open'
Added subscriber: @VilemDuha
Added subscriber: @Sergey
Changed status from 'Open' to: 'Archived'
Thanks for the report, but it is not really a bug, but a specific behavior of how keymap matching currently works.
Thing is, when you define your operator as
text.something
it is supposed to be related to text editor context. Keep this in mind.Now, when you right-click on a button Blender will first check whether shortcut is already defined for this operator within the current context, and if so will let you to edit that. This isn't your case yet.
If there is no current shortcut defined for operator yet, it'll try to deduct which exact keymap to add it. In you case because it's
text.something
Blender will suppose that the operator belongs to "Text" keymap. However, there is no "Text" keymap in the 3d viewport context, hence Blender will not be able to create shortcut for your button.There might be some improvements to such guesses be done, but those are happening outside of the bug tracker.
For the time being, will suggest just to stick to a strict context specification rules, which is a good idea anyway.
the addon we are talking about is called Macro.
Basically it runs any internal script from a custom panel like it would be an operator(even with props :) ), so it can not have a specific context...
maybe, the solution is to define the same operator for different contexts? so I have text.run_macro, object.run_macro e.t.c.?
https://blenderartists.org/forum/showthread.php?343029-Macro-script-runner-make-your-operator-prototyping-faster