Object-Oriented Python Wrapper for Houdini Engine's C API
Note that this is 3rd party binding, not official.
Please visit pyhapi documentation.
You could use either (a) pip or (b) clone and install.
- For Windows, run
powershell ./sethoupath.ps1
it should add houdini's dsolib and bin directory to PATH. - For Linux
Add/opt/hfs<version>/dsolib/
to LD_LIBRARY_PATH
Example:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/hfs17.5/dsolib/
$ pip install pyhapi
Clone this repo and run python setup.py install
- Windows
- Linux
- Python: >3.6
- Numpy: >= 1.15
- Houdini >= 17.5
- License supported:
- Houdini FX
- Houdini Core
- Houdini Engine
- License NOT supported:
- Houdini Engine Indie
- Houdini Indie
- Houdini Apprentice
- License supported:
- Instantiate node/HDA
- Node connect operation
- Node parameter get/set
- Node async cooking
- Marshall in/out curve
- Marshall in/out mesh
- Marshall in/out heightfield
- SessionPool and task-based processing
Following feature in Houdini Engine is NOT supported yet:
- Marshall in/out volume
- PDG execution
Please see documentation for detailed tutorial. ****
import pyhapi as ph
session = ph.HSessionManager.get_or_create_default_session()
See more in
Example: node_networks_operations
hda_asset = ph.HAsset(session, "hda/FourShapes.hda")
asset_node = hda_asset.instantiate(node_name="TestObject").cook()
asset_node.set_param_value("seed", 1.0)
asset_node.set_param_value("foo_attrib", "foo_str")
asset_node.press_button("foo_execute")
See more in
Example: hda_params_getset
Example: hparms_getset
session.save_hip("debug.hip")
see more in
Example: curve_marshall_input
Example: curve_marshall_output
Example: mesh_marshall_input
Example: mesh_marshall_output
Example: heightfield_marshal_input
Example: heightfield_marshal_output
session_pool = ph.HSessionManager.get_or_create_session_pool()
session_pool.run_on_task_producer(producer)
Example: multisession_producer
session_pool = ph.HSessionManager.get_or_create_session_pool()
session_pool.enqueue_task(session_task, i, j)
session_pool.run_all_tasks()
session_pool = ph.HSessionManager.get_or_create_session_pool()
session_pool.run_task_consumer_on_background()
executor = ThreadPoolExecutor(max_workers=4)
for i in range(0,4):
executor.submit(producer, i)