Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyhapi

Downloads

Object-Oriented Python Wrapper for Houdini Engine's C API

Note that this is 3rd party binding, not official.

Documentation

Please visit pyhapi documentation.

Install

You could use either (a) pip or (b) clone and install.

option a.1 setup PATH

  • 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/

option a.2 install through PyPI

$ pip install pyhapi

option b

Clone this repo and run python setup.py install

Supported Platforms

  • Windows
  • Linux

Dependency

  • 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

Features

  • 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

Example Usage

Please see documentation for detailed tutorial. ****

Create a session

import pyhapi as ph
session = ph.HSessionManager.get_or_create_default_session()

See more in
Example: node_networks_operations

Instantiate a HDA

hda_asset = ph.HAsset(session, "hda/FourShapes.hda")
asset_node = hda_asset.instantiate(node_name="TestObject").cook()

Set parameter of node

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

Save HIP file

session.save_hip("debug.hip")

Marshall data

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

Producer/Consumer

session_pool = ph.HSessionManager.get_or_create_session_pool()

session_pool.run_on_task_producer(producer)

Example: multisession_producer

Batch Run

session_pool = ph.HSessionManager.get_or_create_session_pool()

session_pool.enqueue_task(session_task, i, j)

session_pool.run_all_tasks()

Example: multisession_run

Threaded Task Producer

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)

Example: multisession_producer_threaded

Flask Server Demo

Example: server_demo

Release files for pyhapi 0.0.4b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyhapi 0.0.4b2
File Size Uploaded
pyhapi-0.0.4b2.tar.gz 35.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyhapi 0.0.4b2
File Interpreter ABI Platform
pyhapi-0.0.4b2-py3.7.egg Legacy Egg format - - Details
pyhapi-0.0.4b2-py3-none-any.whl Python 3 none any Details

Total release size: 171.1 kB

Release files / pyhapi-0.0.4b2.tar.gz

Download URL pyhapi-0.0.4b2.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6b9b32479655e589411391445556ec671035c088d280c403652772c0c7d46f3e
BLAKE2b-256 checksum
How to use checksums
92c92e0c045aabafc47b5c4c37b5cd6e96fd8c4a35a3293eec9cb6f6e531c3f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.0

Release files / pyhapi-0.0.4b2-py3.7.egg

Download URL pyhapi-0.0.4b2-py3.7.egg
Size 94.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
e1881b6f27ea6cb353a9fbb59be879bc8b8d8d75c9aab4798fe965b7349d0784
BLAKE2b-256 checksum
How to use checksums
fa72feabb18875ac17cee67a61301588830de7de49baa69e7742eff331a0341e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.0

Release files / pyhapi-0.0.4b2-py3-none-any.whl

Download URL pyhapi-0.0.4b2-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eaa430642d50a7a621f3034d75a19534609fd82233c337c5b29314e3d5615ce
BLAKE2b-256 checksum
How to use checksums
d7b49504a65898d043b3451717514620ef6f29e1754fb44aec968f167936fa58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page