Setting default hotkeys for a tool distributed in a package

   875   0   2
User Avatar
Member
161 posts
Joined: May 2015
Offline
Hello everybody

I am developing a tool that is being distributed through a package. The tool is adding functionnalities to the animation graph and those new functionnalities are available to the user through a custom menu added to the animation graph (by including a custom AnimationEditorGraphMenu.xml in my package). I would like to add hotkeys to those menu entries, but I am not sure what would be the correct way. By looking in the houdini installation folder, I discovered that hotkeys are set by the Hotkeys file found in houdini\config\Hotkeys folder. I tried to replicate this pattern in my package, but this resulted in a lot of errors when launching houdini (hotkey symbols not being found). So I guess that this way is destructive and not legit...

My second attempt was to use a keymap override instead of a config\Hotkeys folder. So I created a Houdini.keymap.overrides file that I saved at the root of my package. This seems to work, but I wonder if this will only work for the Houdini keymap? What if the user made a custom keymap?

In the documentation, I see that there is a hou.hotkeys python module : https://www.sidefx.com/docs/houdini/hom/hou/hotkeys.html [www.sidefx.com]

Should I use this instead? Is there a way to execute a python file when the package is loaded that would create the needed contexts and hotkey assignments? (like a startup script I suppose...)

To summarize, my question is: what would be the most legit way of distributing a package with hotkeys assignations?

Thanks in advance for any help
  • Quick Links