Houdini 17.0

Python Scripting

How to script Houdini using Python and the Houdini Object Model.

On this page

Overview

The Houdini Object Model (HOM) is an application programming interface (API) that lets you get information from and control Houdini using the Python scripting language. HOM replaces the functionality of Houdini’s previous scripting solutions, the expression language and HScript.

In Python, the hou package is the top of a hierarchy of modules, functions, and classes that define the HOM. The hou module is automatically imported when you are writing expressions in the parameter editor and in the hython command-line shell.

Which Python?

Mac

On Mac OS X, Houdini uses the system’s Python.

Windows

On Windows, Houdini uses the version of Python installed with Houdini.

Linux

On Linux, Houdini does not look at $PATH when trying to search and load the Python library. Instead it searches all the paths in $LD_LIBRARY_PATH, then /lib, and then /usr/lib. If it can’t find a suitable Python library in the system, it uses the one in $HFS. If your Python library is not in a standard location, you should add its directory path to $LD_LIBRARY_PATH.

Subtopics

Getting started

Next steps

Python viewer states

You can write viewer states in Python that let you customize user interaction in the viewport for your node.

Guru level

Reference

  • hou

    Module containing all the sub-modules, classes, and functions to access Houdini.

  • Alembic extension functions

    Utility functions for extracting information from Alembic files.

Houdini 17.0

Getting started

Using Houdini

  • Geometry

    How Houdini represents geometry and how to create and edit it.

  • Copying and instancing

    How to use copies (real geometry) and instances (loaded or created at render time).

  • Animation

    How to create and keyframe animation in Houdini.

  • Character

    How to rig and animate characters in Houdini.

  • Rendering

    How to render images and animation from the 3D scene.

  • Materials

    How to assign materials and create custom materials for shading.

  • Compositing

    Houdini’s compositing networks let you create and manipulate images such as renders.

  • Digital assets

    Digital assets let you create reusable nodes and tools from existing networks.

  • Import and export

    How to get scene, object, and other data in and out of Houdini.

  • MPlay viewer

    Using Houdini’s stand-alone image viewer.

Dynamics

  • Particles

    How to create particle simulations.

  • Dynamics

    How to use Houdini’s dynamics networks to create simulations.

  • Pyro

    How to simulate smoke, fire, and explosions.

  • Fluids

    How to set up fluid and ocean simulations.

  • Grains

    How to simulate grainy materials (such as sand).

  • Crowd simulations

    How to create and simulate crowds of characters in Houdini.

  • Hair and Fur

    How to create, style, and add dynamics to hair and fur.

  • Finite Elements

    How to create and simulate deformable objects

Nodes

  • OBJ - Object nodes

    Object nodes represent objects in the scene, such as character parts, geometry objects, lights, cameras, and so on.

  • SOP - Geometry nodes

    Geometry nodes live inside Geo objects and generate geometry.

  • DOP - Dynamics nodes

    Dynamics nodes set up the conditions and rules for dynamics simulations.

  • VOP - Shader nodes

    VOP nodes let you define a program (such as a shader) by connecting nodes together. Houdini then compiles the node network into executable VEX code.

  • ROP - Render nodes

    Render nodes either render the scene or set up render dependency networks.

  • CHOP - Channel nodes

    Channel nodes create, filter, and manipulate channel data.

  • COP2 - Compositing nodes

    Composite nodes create, filter, and manipulate image data.

Reference

  • Menus

    Explains each of the items in the main menus.

  • Viewers

    Viewer pane types.

  • Panes

    Documents the options in various panes.

  • Windows

    Documents the options in various user interface windows.

  • Stand-alone utilities

    Houdini includes a large number of useful command-line utility programs.

  • Python Scripting

    How to script Houdini using Python and the Houdini Object Model.

  • Expression functions

    Expression functions let you compute the value of parameters.

  • HScript commands

    HScript is Houdini’s legacy scripting language.

  • VEX

    VEX is a high-performance expression language used in many places in Houdini, such as writing shaders.

  • Properties

    Properties let you set up flexible and powerful hierarchies of rendering, shading, lighting, and camera parameters.

  • Python Panels

    You can script custom pane types using Python to create your own UIs.

  • Galleries

    Pre-made materials included with Houdini.