You can’t instantiate this object directly, call hou.shelves.newTool() instead.
Deletes the tool from Houdini session and removes its definition from the file it’s stored in.
setData(script='', language=hou.scriptLanguage.Python, icon='', help='', help_url='', network_categories=(), viewer_categories=(), cop_viewer_categories=(), network_op_type='', viewer_op_type='', locations=())
Convenience method for setting multiple options at once, rather than
Sets various options on the tool based on optional keyword arguments you pass.
# Get a tool t = shelves.tool("geometry_sphere") # Set the tool's icon and help URL t.setData(icon="SOP_sphere", help_url="tool:sphere")
Help and icon
Sets the tool’s help text. Houdini will parse this as wiki text and display it in the help viewer when the user requests help for this tool. To have the help viewer go to a URL instead, use setHelpURL.
Returns the tool’s help text.
Sets a URL the help viewer should go to when the user requests help for this tool.
If this is not empty, Hoduini will open this URL in the help viewer
instead of parsing and displaying the contents of
Returns the URL pointing to this tool’s help.
Sets a new icon string for the tool. The string can contain a file path or
URL pointing to an SVG file or an image file Houdini knows how to load.
You can use an
opdef: path to refer to an icon file inside an asset.
Returns the tool’s icon string.
Sets the text of the script to run when the user clicks the tool in the shelf. See how to write a tool script for information on the global variables available to the script and tips for common tasks.
Returns the text of the script that runs when the user clicks the tool.
Sets a new language for the script, where language is a value from the
hou.scriptLanguage module (usually
t = shelves.tool("tool_1") t.setLanguage(hou.scriptLanguage.Hscript) t.setScript("message hello")
We highly recommend writing scripts in Python rather than Hscript.
→ hou.scriptLanguage enum value
Returns a value representing the language in which the tool script is written.
>>> t = shelves.tool("geometry_sphere") >>> t.language() == hou.scriptLanguage.Python True
Sets the description of the places that the tool should show up in the UI. Eg, a tool could be configured to be included in the network pane’s TAB menu but not in the viewport pane’s TAB menu.
Set the tool categories. The categories are used to further control the visibility of the tool. For example, some tools specify “Mantra” or “RenderMan” as keywords, and they show up in the TAB menu only if the specified renderer is configured as active in the preferences pane.
Sets the operator type to be associated with the tool. The tool will show up in the TAB menu only if the operator can be created. For example, some operator types are scoped only to a particular parent, thus the tool that creates nodes of this type makes sense only inside that parent.
→ tuple of hou.NodeTypeCategory
Returns the categories specified for the tool.
→ tuple of
Returns the submenus of the TAB menu in which the tool is included.
Returns the operator type associated with this tool.
Methods from hou.ShelfElement
Sets the path string for where this object’s definition is stored.
Returns the file that contains the definition of this object.
Returns the file location description in a human readable format. For example, it is a file path for disk files, and information about an HDA if the element is stored in an HDA tool section.
Sets this object’s internal name. This is how you refer to the object in scripts.
The name has similar rules to naming Houdini nodes: it must not start with a number, and can only contain letters, numbers, an underscores.
For example, if a Tool objects name is
foo, you can get a reference
to it using:
footool = shelves.tool("foo")
Returns the internal name of this object.
Multiple objects may have the same name (for example, two
different assets might both provide a
hammer tool), but only one will
be active at a time in a Houdini session.
Sets the object’s human-readable label. This is what’s displayed in the UI.
Returns the object’s human-readable label.
# Get a reference to a tool t = hou.shelves.tool("geometry_sphere") # Prevent the tool from being modified t.setReadOnly(True) # Allow the tool to be modified t.setReadOnly(False)
True if the element is read-only (can’t be edited).