Ondrej

Ondrej

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

My Badges

SideFX Staff
Since Jul 2005

Recent Forum Posts

Which hotkey action is conflict? Feb. 12, 2025, 10:33 a.m.

It's almost certainly the Flood Fill Selection hotkey. It should be in that list of potential conflicts, but it's a long list and easy to miss.

onKeyEvent issue (python) Sept. 19, 2024, 10:21 a.m.

The new hotkey system in 20.5 does indeed give state hotkey contexts priority during hotkey resolution. However, to take advantage of that, you need to use the hotkey system, i.e., register a hotkey context symbol, hotkey action symbols, and default key bindings for that hotkey context. Without that you're at the mercy of the hard-coded order in which various key event handlers are triggered by Houdini. It also good practice to do in general so that key bindings can be customized through the hotkey manager.

I think the examples/documentation are still a little behind in this respect, so the easiest way to see an example is to look at one of the python states we're shipping. For example, $HFS/houdini/viewer_states/sidefx_clip.py. The way it's done there is designed to work under both the old and new hotkey systems in 20.0 and up, though of course the new system is only used by 20.5 and up.

What you're looking for is the use of the `hou.PluginHotkeyDefinitions` object to register the various hotkey symbols and default bindings with the viewer state template in `createViewerStateTemplate()`.

In the `onKeyEvent()` function, you'll want to note how `viewerstate.utils.hotkeySymbolOrKeyString()` is used instead of the raw key string from the `ui_event`, and compared against a hotkey symbol using `hou.hotkeys.isKeyMatch()`.

The hotkey system is broken in Houdini 20.5 July 29, 2024, 4:18 p.m.

Ondrej
Unfortunately, I don't think there is a way to invoke this type of action script directly through python, or, if there is, I'm aware of it.

Turns out that I was indeed unaware of it. We added a hou.Parm.pressScriptActionButton() method in 20.5.