On this page |
Overview ¶
The PluginHotkeyDefinitions
class lets you build a set of hotkey definitions for a viewer state and its menu.
Methods ¶
__init__()
Creates a hou.PluginHotkeyDefinitions object.
definitions = hou.PluginHotkeyDefinitions()
addCommandCategory(symbol, label, description)
Adds a command category under which new commands will be added. Command categories define a tree structure for organizing commands. In Houdini 20, the hotkey context and command category are one and the same.
symbol
A string containing a full dotted hotkey symbol representing the category. For example:
h.pane.gview.state.sop.my_state
label
A human readable title for the category. For example, “Demo State Operation”.
description
A human readable description of the category. This should generally be one to three sentences of help text for the category.
addCommand(symbol, label, description)
Adds a hotkey symbol that represents an action or command.
symbol
A string containing a full dotted hotkey symbol.
label
A human readable title for the action. For example, “Delete Selected”.
description
A human readable description of the action. This should generally be one to three sentences of help text for the action.
addContext(symbol, label, description)
Adds a context to contain bindings of keys to actions. In Houdini 20, this is unused as key bindings are associated solely with the command.
symbol
A string containing a full dotted hotkey symbol representing the context. For example:
h.pane.gview.state.sop.my_state
label
A human readable title for the context. For example, “Demo State Operation”.
description
A human readable description of the context. This should generally be one to three sentences of help text for the context.
addDefaultBinding(context, command, assignments)
Adds a default binding assigning keys to a given command in a given context. In Houdini 20, where key bindings are associated solely with the command, only the bindings where the parent command category is specified as the context are used.
context
A string containing a full dotted context symbol representing the contextin which to create the binding. For example:
h.pane.gview.state.sop.my_state
command
A string containing a full dotted hotkey symbol representing the command for the binding. For example:
h.pane.gview.state.sop.my_state.do_something
assignments
An optional list of shortcut strings to be used as the default assignments for this command in this context.
containsCommandCategory(symbol)
→ bool
Returns whether this hotkey definitions object contains the specified command category.
symbol
A string containing a full dotted hotkey symbol representing the category. For example:
h.pane.gview.state.sop.my_state
containsCommand(symbol)
→ bool
Returns whether this hotkey definitions object contains the specified command.
symbol
A string containing a full dotted hotkey symbol representing the command. For example:
h.pane.gview.state.sop.my_state.do_something
containsContext(symbol)
→ bool
Returns whether this hotkey definitions object contains the specified context.
symbol
A string containing a full dotted hotkey symbol representing the context. For example:
h.pane.gview.state.sop.my_state
containsDefaultBinding(context, command)
→ bool
Returns whether this hotkey definitions object contains a default binding for the specified command in the specified context.
context
A string containing a full dotted hotkey symbol representing the context. For example:
h.pane.gview.state.sop.my_state
command
A string containing a full dotted hotkey symbol representing the command for the binding. For example:
h.pane.gview.state.sop.my_state.do_something