Skip to main content
Commonmark migration
Source Link

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?

##Edit:

Edit:

For the script that I linked to, simply registering the module instead of the operator class does not provide the user with the hotkey controls.

Here are some screenshots showing what I mean in case of any misunderstandings:

enter image description here

enter image description here

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?

##Edit:

For the script that I linked to, simply registering the module instead of the operator class does not provide the user with the hotkey controls.

Here are some screenshots showing what I mean in case of any misunderstandings:

enter image description here

enter image description here

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?

Edit:

For the script that I linked to, simply registering the module instead of the operator class does not provide the user with the hotkey controls.

Here are some screenshots showing what I mean in case of any misunderstandings:

enter image description here

enter image description here

added 418 characters in body
Source Link
Jake Dube
  • 8.6k
  • 2
  • 33
  • 74

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?

##Edit:

For the script that I linked to, simply registering the module instead of the operator class does not provide the user with the hotkey controls.

Here are some screenshots showing what I mean in case of any misunderstandings:

enter image description here

enter image description here

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?

##Edit:

For the script that I linked to, simply registering the module instead of the operator class does not provide the user with the hotkey controls.

Here are some screenshots showing what I mean in case of any misunderstandings:

enter image description here

enter image description here

Source Link
Jake Dube
  • 8.6k
  • 2
  • 33
  • 74

How to allow setting hotkey in add-on

Someone just asked here about adding a custom hotkey to an add-on that I made a some time ago. This add-on, for some reason, doesn't show any hotkey setup options when you right click on it like most operators show in Blender.

After doing some research, and looking through add-ons that I have made in the past, it appears that registering operators like...

bpy.utils.register_class(SomeClassName)

...doesn't allow the operator to have the hotkeys, but registering the entire module...

bpy.utils.register_module(__name__)

...does show the hotkey controls.

Is this intended behavior? Is there anything to do if you don't want to register the entire module like this?