Skip to main content

A object-oriented python wrapper for houdini engine's C API

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhapi-0.0.4b1.tar.gz (35.9 kB view details)

Uploaded Source

Built Distributions

pyhapi-0.0.4b1-py3.7.egg (94.2 kB view details)

Uploaded Egg

pyhapi-0.0.4b1-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file pyhapi-0.0.4b1.tar.gz.

File metadata

  • Download URL: pyhapi-0.0.4b1.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyhapi-0.0.4b1.tar.gz
Algorithm Hash digest
SHA256 1cb4d34e5f4892425ee94df6f22013000bc513df12efc717d10d341c1fa53439
MD5 07b5dda6bbc4153ffcdc2d181609e712
BLAKE2b-256 e79cfd7221aaff1d83e82229068a93d2cae9434d917ea9f59c3bafee82532e65

See more details on using hashes here.

File details

Details for the file pyhapi-0.0.4b1-py3.7.egg.

File metadata

  • Download URL: pyhapi-0.0.4b1-py3.7.egg
  • Upload date:
  • Size: 94.2 kB
  • Tags: Egg
  • Uploaded using 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

File hashes

Hashes for pyhapi-0.0.4b1-py3.7.egg
Algorithm Hash digest
SHA256 c173de3e63ca1411254c01d15ff8b2aff2457ebc2c6ea0bfe0c26d19fb6f5d52
MD5 f1aeb7611a17eb9f5c193372f2a4fd8b
BLAKE2b-256 9b518698022deede466cfaecfbc9530dd7ca39813d38fe773f0622e36b5d6760

See more details on using hashes here.

File details

Details for the file pyhapi-0.0.4b1-py3-none-any.whl.

File metadata

  • Download URL: pyhapi-0.0.4b1-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyhapi-0.0.4b1-py3-none-any.whl
Algorithm Hash digest
SHA256 6b2aa6347fc3a8b877f36eda20b8b478734d83f0d9640f58b3ef918cb9d07b4b
MD5 47d6b7a6439112ceda68e7ef7a54d1a4
BLAKE2b-256 aeb5f34ef8255883c5453aa2e6bec91341146f11d263f57c1efcadf9ce9b5466

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page