Call Houdini tools directly without the AI
A few hagent subcommands skip the AI and talk to the running Houdini directly through the Bridge: list online instances, read the scene context, call the same Houdini tools the agent uses, or run Python in Houdini. They use no model quota and print JSON, which makes them a good fit for scripts and pipelines.
Subcommands at a glance
| Command | What it does |
|---|---|
hagent instances |
Lists online Houdini instances (JSON) |
hagent context |
Current scene context: .hip, selected nodes, network path (JSON) |
hagent tools |
Lists every Houdini-side tool with its description |
hagent tool <tool name> '<JSON arguments>' |
Calls one tool directly |
hagent py "<code>" |
Runs Python in Houdini, the same as calling execute_python |
See which Houdini sessions are online
hagent instances
There's one entry per instance, with its port, whether it's online, its process ID pid, the Houdini version houdini, and the current scene hip.
Call a tool
- Find the tool name with
hagent tools. - Pass the arguments as a JSON object:
hagent tool get_network_structure '{"network_path": "/obj"}'
For long arguments, put them in a file and pass it with @file:
hagent tool execute_python @args.json
Run Python
hagent py "print(hou.hipFile.path())"
hagent py @fix_paths.py
The code runs inside Houdini, so hou is available directly. @file reads the code from a file.
Choose an instance and a timeout
context, tool and py accept two options:
| Option | What it does |
|---|---|
--port <port> |
Which Houdini to use (see hagent instances for ports); defaults to the most recently started instance |
--timeout <seconds> |
Timeout for a single request, 180 seconds by default |
hagent py "print(len(hou.node('/obj').children()))" --port 45173 --timeout 30
Exit codes
| Exit code | Meaning |
|---|---|
0 |
Success |
1 |
Couldn't reach Houdini, or the request failed (the error goes to standard error) |
2 |
The tool ran but reported a failure |
These subcommands skip confirmation before actions and don't create undoable change cards. hagent py and tools that modify the scene change it directly, so save your .hip first.
If it can't connect
Run hagent instances first to see whether Houdini is online. An empty list means Houdini hasn't loaded the Houdini Agent connection plugin; see Fix a Houdini connection problem.